Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f0IK25099543 for ; Thu, 18 Jan 2001 15:02:05 -0500 (EST) (envelope-from pgsql-general-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0IHTE074703; Thu, 18 Jan 2001 12:29:14 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f0IHKpx55392; Thu, 18 Jan 2001 12:20:51 -0500 (EST) (envelope-from news) From: "Zolof" X-Newsgroups: comp.databases.postgresql.docs, comp.databases.postgresql.general, comp.databases.postgresql.interfaces, comp.databases.postgresql.sql Subject: pl/pgSQL & transaction Date: Thu, 18 Jan 2001 18:17:27 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 15 Message-ID: <9478lh$1m2r$2@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: pgsql-docs@postgresql.org.pgsql-general@postgresql.org.pgsql-interfaces@postgresql.org.pgsql-sql@postgresql.org X-Archive-Number: 200101/863 X-Sequence-Number: 3083 This code doesn't work. I use Begin Work to start a transaction but BEGIN is a PL/pgSQL command so I have a parse error when executing it. CREATE FUNCTION a () RETURNS int4 AS ' BEGIN BEGIN WORK; COMMIT WORK; return 1; END; ' LANGUAGE 'plpgsql'; What's wrong ????