Skip site navigation (1) Skip section navigation (2)

Re: SQL stored function inserting and returning data in a row.

From: "Daniel Caune" <daniel(dot)caune(at)ubisoft(dot)com>
To: "Gerardo Herzig" <gherzig(at)fmed(dot)uba(dot)ar>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SQL stored function inserting and returning data in a row.
Date: 2008-01-11 13:55:02
Message-ID: 1E293D3FF63A3740B10AD5AAD88535D206F41789@UBIMAIL1.ubisoft.org (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-sql
> What about
> $$
> INSERT INTO .... ;
> select currval('seq_matchmaking_session_id');
> $$ language sql;
> 
> ?

Indeed... :-( For some reason, I thought that it was not possible to
have to SQL statement in an SQL stored function.

By the way, is there any performance difference between pure SQL and
PL/pgSQL stored functions?  If I remember correctly there was such a
distinction between pure SQL statement and PL/PLSQL stored procedures
(Oracle), in the sense that PL/PLSQL stored procedures are executed
within the PL/PLSQL engine which sends pure SQL statements to the SQL
engine for execution.  There is a little overhead between PL/PLSQL and
SQL engines.

Regards,

--
Daniel

In response to

Responses

pgsql-admin by date

Next:From: Pavel StehuleDate: 2008-01-11 14:17:53
Subject: Re: SQL stored function inserting and returning data in a row.
Previous:From: naliniDate: 2008-01-11 11:39:49
Subject: Re: Postgres replication

pgsql-sql by date

Next:From: Pavel StehuleDate: 2008-01-11 14:17:53
Subject: Re: SQL stored function inserting and returning data in a row.
Previous:From: Marcin StępnickiDate: 2008-01-11 11:19:17
Subject: Re: SQL stored function inserting and returning data in a row.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group