X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D251CD1D4C3 for ; Sat, 10 Apr 2004 19:19:48 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 36994-01 for ; Sat, 10 Apr 2004 19:19:49 -0300 (ADT) Received: from guinness.cs.stevens-tech.edu (guinness.cs.stevens-tech.edu [155.246.89.8]) by svr1.postgresql.org (Postfix) with ESMTP id C5454D1D06F for ; Sat, 10 Apr 2004 19:19:46 -0300 (ADT) Received: from pink-elephant.cs.stevens-tech.edu (pink-elephant.cs.stevens-tech.edu [155.246.81.117]) by guinness.cs.stevens-tech.edu (Postfix) with ESMTP id DF53D141663; Sat, 10 Apr 2004 18:19:54 -0400 (EDT) Received: by pink-elephant.cs.stevens-tech.edu (Postfix, from userid 4405) id 15BB58D0A9; Sat, 10 Apr 2004 18:19:48 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by pink-elephant.cs.stevens-tech.edu (Postfix) with ESMTP id DBFAE8D061; Sat, 10 Apr 2004 18:19:48 -0400 (EDT) Date: Sat, 10 Apr 2004 18:19:48 -0400 (EDT) From: Yasir Malik To: Kemin Zhou Cc: pgsql-sql@postgresql.org Subject: Re: begin update ... syntax error In-Reply-To: <407867FE.1030501@ferring.com> Message-ID: References: <407867FE.1030501@ferring.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/98 X-Sequence-Number: 17473 Kemin, Instead of just begin, have "begin;" and put "commit;" at the end of the SQL statement. Go here for more information: http://developer.postgresql.org/docs/postgres/tutorial-transactions.html Regards, Yasir On Sat, 10 Apr 2004, Kemin Zhou wrote: > Date: Sat, 10 Apr 2004 14:32:46 -0700 > From: Kemin Zhou > To: pgsql-sql@postgresql.org > Subject: [SQL] begin update ... syntax error > > I was trying to speed up a simple update query > > fri=# begin > fri-# update tabA set nobegin=tmp.nobegin, noend=tmp.noend > fri-# from tmp > fri-# where tabA.acc=tmp.acc; > ERROR: syntax error at or near "update" at character 7 > > The same query can be run with no problem if not starting with BEGIN. > > Does mean that BEGIN cannot preceed UPDATE? > > Or I am making some obvious miskate? > > Kemin > > > > > ********************************************************************** > Proprietary or confidential information belonging to Ferring Holding SA or to one of its affiliated companies may be contained in the message. If you are not the addressee indicated in this message (or responsible for the delivery of the message to such person), please do not copy or deliver this message to anyone. In such case, please destroy this message and notify the sender by reply e-mail. Please advise the sender immediately if you or your employer do not consent to e-mail for messages of this kind. Opinions, conclusions and other information in this message represent the opinion of the sender and do not necessarily represent or reflect the views and opinions of Ferring. > ********************************************************************** > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html >