Posts Tagged ‘functions’

Waiting for 8.4 - sql-wrappable RETURNING

2008-11-03 14:37:16 CET | No Comments | Tags: , , , ,

In PostgreSQL 8.2, we got “RETURNING” clause in INSERT/UPDATE/DELETE queries.

Unfortunately it could not be used as source of rows for anything in sql.

insert into table_backup delete from table where ... returning *;

Well, it’s still not possible, but it is a one step closer, thanks to patch written and committed by Tom Lane on 31st of October:

Allow SQL-language functions to return the output of an INSERT/UPDATE/DELETE
RETURNING clause, not just a SELECT as formerly.
 
A side effect of this patch is that when a set-returning SQL function is used
in a FROM clause, performance is improved because the output is collected into
a tuplestore within the function, rather than using the less efficient
value-per-call mechanism.

- MORE -

Waiting for 8.4 - pl/* srf functions in selects

2008-11-03 14:03:01 CET | 4 Comments | Tags: , , , , , ,

On 28th of October Tom Lane committed his patch that changes some internals of functions, but it also adds interesting capability.

- MORE -

Waiting for 8.4 - \ef in psql

2008-09-06 21:45:46 CEST | No Comments | Tags: , , , ,

Today, Tom Lane committed patch, written by Abhijit Menon-Sen, which adds interesting feature to psql. Namely - it simplifies changing definition of functions.

- MORE -

Waiting for 8.4 - RETURNS TABLE

2008-08-04 14:21:53 CEST | 1 Comment | Tags: , , , , ,

Pavel Stehule wrote, and Tom Lane committed patch which ads new syntax for set-returning functions: “RETURNS TABLE”.

- MORE -

Waiting for 8.4 - variadic functions

2008-07-31 15:14:15 CEST | No Comments | Tags: , , ,

Pavel Stehule wrote, and then Tom Lane committed (on 16th of July), patch which adds to PostgreSQL support for functions with variable number of arguments.

- MORE -

Conditional DDL?

2008-06-18 14:53:23 CEST | 7 Comments | Tags: , , , , ,

Every now and then I see people ask the question - how to create table if it doesn’t exist yet, how to drop it, but only if it does exist and so on.

Well, starting from 8.2 dropping should be not a problem anymore. But what about create? Alter?

Let’s try to do it…

- MORE -

Waiting for 8.4 - function stats

2008-05-15 17:33:36 CEST | 4 Comments | Tags: , , , , , , ,

Today another great patch, committed by Tom Lane. This patch was written by Martin Pihlak (with some edits by Tom).

- MORE -