X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 294429DCA05 for ; Thu, 26 Jan 2006 13:36:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64139-01 for ; Thu, 26 Jan 2006 13:36:55 -0400 (AST) X-Greylist: delayed 00:27:38.636516 by SQLgrey- Received: from relay01.mdc.ubisoft.com (relay01.mdc.ubisoft.com [216.98.56.134]) by postgresql.org (Postfix) with ESMTP id 007359DCA18 for ; Thu, 26 Jan 2006 13:36:53 -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 A58A44BB51 for ; Thu, 26 Jan 2006 12:09:14 -0500 (EST) Received: from UBIMAIL1.ubisoft.org ([10.129.1.15]) by mdc-owa01.ubisoft.org with Microsoft SMTPSVC(6.0.3790.1830); Thu, 26 Jan 2006 12:09:14 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6229B.3BBD1957" Subject: [HELP] Defining a function as a procedure Date: Thu, 26 Jan 2006 12:09:14 -0500 Message-ID: <1E293D3FF63A3740B10AD5AAD88535D201663CC5@UBIMAIL1.ubisoft.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [HELP] Defining a function as a procedure Thread-Index: AcYimzuLW2XgVzr3TEei6B/6OvfFLQ== From: "Daniel Caune" To: X-OriginalArrivalTime: 26 Jan 2006 17:09:14.0320 (UTC) FILETIME=[3BAE6D00:01C6229B] 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: by amavisd-new at hub.org X-Spam-Status: No, score=0.001 required=5 tests=[HTML_MESSAGE=0.001] X-Spam-Score: 0.001 X-Spam-Level: X-Archive-Number: 200601/189 X-Sequence-Number: 23978 This is a multi-part message in MIME format. ------_=_NextPart_001_01C6229B.3BBD1957 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, =20 Is there a way to define a function as a procedure, I mean a function that returns nothing. =20 CREATE OR REPLACE FUNCTION foo() AS $$ BEGIN END; $$ LANGUAGE 'plpgsql'; =20 Actually, PostgreSQL complains as a "function result type must be specified". I can patch my function so that it compiles but that won't be really nice: =20 CREATE OR REPLACE FUNCTION foo() RETURNS int AS $$ BEGIN RETURN 1; END; $$ LANGUAGE 'plpgsql'; =20 Is there any other prettier way to do that? =20 Thanks, =20 =20 -- Daniel =20 ------_=_NextPart_001_01C6229B.3BBD1957 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

Is there a way to define a function as a = procedure, I mean a function that returns nothing.

 

CREATE OR REPLACE FUNCTION = foo(<in-parameters>)

AS = $$

BEGIN

  = <update-some-tables>

END;

$$ LANGUAGE = 'plpgsql';

 

Actually, PostgreSQL complains as a = “function result type must be specified”.  I can patch my function so = that it compiles but that won’t be really = nice:

 

CREATE OR REPLACE FUNCTION = foo(<in-parameters>)

  RETURNS = int

AS = $$

BEGIN

  = <update-some-tables>

  = RETURN = 1;

END;

$$ LANGUAGE = 'plpgsql';

 

Is there any other prettier way to do = that?

 

Thanks,

 

 

--

Daniel

 

------_=_NextPart_001_01C6229B.3BBD1957--