Given this type: -- Just for testing purposes: CREATE TYPE testType as (name text) I can get the value of a field dynamically with this function:
Question: How can I declare a variable of the same type a parameter in a stored function? The simple answer is use %TYPE, this works:
I have the following function in Postgres: CREATE OR REPLACE FUNCTION point_total(user_id integer, gametime date)
I keep all my functions in a text file with \'CREATE OR REPLACE FUNCTION somefunction\'. So if I add or change some function I just feed the file to psql.
I\'m trying to add to my PostgreSQL a very simple function, to convert IP addresses from an integer to a text format.
I am using PostgreSQL 8.4 and I want to create a function that returns a query with many rows. The following function does not work:
I am trying to write a trigger function in PostgreSQL 8.2 that will dynamically use TG_TABLE_NAME to generate and execute a SQL statement.I can find all kinds of examples for later versions of Postgre
I want to tokenize text开发者_JS百科 in my database with RegEx and store the resulting tokens in a table. First I want to split the words by spaces, and then each token by punctuation.
I\'m developing an web based application written in PHP5, which basically is an UI on top of a database. To give users a more flexible tool I want to embed a scripting language, so they can do more co
The following PL/pgSQl script returns the correct number of rows, but the output is a list of开发者_如何学C comma separated values in brackets as follows: