Re: SQL stored function inserting and returning data in a row. - Mailing list pgsql-sql

From Daniel Caune
Subject Re: SQL stored function inserting and returning data in a row.
Date
Msg-id 1E293D3FF63A3740B10AD5AAD88535D206F41789@UBIMAIL1.ubisoft.org
Whole thread Raw
In response to Re: SQL stored function inserting and returning data in a row.  (Gerardo Herzig <gherzig@fmed.uba.ar>)
Responses Re: SQL stored function inserting and returning data in a row.  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Re: SQL stored function inserting and returning data in a row.  ("Marc Mamin" <M.Mamin@intershop.de>)
List pgsql-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


pgsql-sql by date:

Previous
From: "Marcin Stępnicki"
Date:
Subject: Re: SQL stored function inserting and returning data in a row.
Next
From: "Pavel Stehule"
Date:
Subject: Re: SQL stored function inserting and returning data in a row.