plpgsql
How to set value of composite variable field using dynamic SQL
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:[详细]
2023-04-12 11:29 分类:问答Declare variable of composite type in PostgreSQL using %TYPE
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:[详细]
2023-04-10 21:10 分类:问答Set a default return value for a Postgres function
I have the following function in Postgres: CREATE OR REPLACE FUNCTION point_total(user_id integer, gametime date)[详细]
2023-04-10 16:19 分类:问答DROP FUNCTION without knowing the number/type of parameters?
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.[详细]
2023-04-09 16:21 分类:问答PostgreSQL ERROR: there is no built-in function named " (SQL state 42883)
I\'m trying to add to my PostgreSQL a very simple function, to convert IP addresses from an integer to a text format.[详细]
2023-04-08 10:52 分类:问答Return a query from a function?
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:[详细]
2023-04-07 17:14 分类:问答How to dynamically use TG_TABLE_NAME in PostgreSQL 8.2?
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[详细]
2023-04-07 09:00 分类:问答Is it possible to tokenize text in PL/PGSQL using regular expressions?
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.[详细]
2023-04-07 07:31 分类:问答Embed python/dsl for scripting in an PHP web application
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[详细]
2023-04-06 18:49 分类:问答PL/PgSQL: RETURNS TABLE output is comma delimited without values
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:[详细]
2023-04-03 21:30 分类:问答