Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 89B632E47E5 for ; Fri, 11 Jan 2008 09:55:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 25240-03 for ; Fri, 11 Jan 2008 09:55:35 -0400 (AST) Received: from relay02.mdc.ubisoft.com (relay02.mdc.ubisoft.com [216.98.56.135]) by postgresql.org (Postfix) with ESMTP id 60AA22E475D for ; Fri, 11 Jan 2008 09:55:05 -0400 (AST) Received: from mdc-owa01.ubisoft.org (srvowa1-mdc.ubisoft.org [10.129.1.20]) by smarthost.mdc.ubisoft.com (Postfix) with ESMTP id 657254C8EE; Fri, 11 Jan 2008 08:54:48 -0500 (EST) Received: from UBIMAIL1.ubisoft.org ([10.129.1.15]) by mdc-owa01.ubisoft.org with Microsoft SMTPSVC(6.0.3790.1830); Fri, 11 Jan 2008 08:55:02 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: SQL stored function inserting and returning data in a row. Date: Fri, 11 Jan 2008 08:55:02 -0500 Message-ID: <1E293D3FF63A3740B10AD5AAD88535D206F41789@UBIMAIL1.ubisoft.org> In-Reply-To: <47874CEB.3010803@fmed.uba.ar> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] SQL stored function inserting and returning data in a row. Thread-Index: AchUQR76iyz3PlimSd+5Pq26D5pvGAAF3aWw From: "Daniel Caune" To: "Gerardo Herzig" Cc: X-OriginalArrivalTime: 11 Jan 2008 13:55:02.0945 (UTC) FILETIME=[9046F110:01C85459] X-Ubisoft-MailScanner-Information: Please contact administrators@ubisoft.qc.ca X-Ubisoft-MailScanner: Found to be clean X-Ubisoft-MailScanner-SpamCheck: X-MailScanner-From: daniel.caune@ubisoft.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/91 X-Sequence-Number: 29944 > What about > $$ > INSERT INTO .... ; > select currval('seq_matchmaking_session_id'); > $$ language sql; >=20 > ? 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