Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BEC1E474E53 for ; Wed, 27 Nov 2002 06:28:59 -0500 (EST) Received: from smtp.noos.fr (descartes.noos.net [212.198.2.74]) by postgresql.org (Postfix) with ESMTP id CA5284759AF for ; Wed, 27 Nov 2002 06:28:56 -0500 (EST) Received: (qmail 13067558 invoked by uid 0); 27 Nov 2002 11:05:18 -0000 Received: from unknown (HELO Idfr4.idfr.net) ([195.132.30.26]) (envelope-sender ) by 212.198.2.74 (qmail-ldap-1.03) with SMTP for ; 27 Nov 2002 11:05:18 -0000 Message-Id: <5.0.0.25.0.20021127120232.00c69aa0@pop.noos.fr> X-Sender: lpatureau@pop.noos.fr X-Mailer: QUALCOMM Windows Eudora Version 5.0 Date: Wed, 27 Nov 2002 12:05:11 +0100 To: pgsql-sql@postgresql.org From: Laurent Patureau Subject: Function and insert Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/416 X-Sequence-Number: 10558 Hi, I want to do a function that insert a row on a table like : CREATE FUNCTION ajout_secu(INT4) RETURNS OID AS 'INSERT INTO test_2 VALUES($1);' LANGUAGE 'SQL'; PG refuse to accept the type returns oid as the function is not a SELECT. What can I do ? thanks for your help, LP