From skarthi98@hotmail.com Thu Apr 12 22:44:27 2007 Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 1E2679FBA5E; Thu, 12 Apr 2007 19:44:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 81943-10; Thu, 12 Apr 2007 19:44:17 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bay0-omc3-s37.bay0.hotmail.com (bay0-omc3-s37.bay0.hotmail.com [65.54.246.237]) by postgresql.org (Postfix) with ESMTP id 815B59FB831; Thu, 12 Apr 2007 19:44:21 -0300 (ADT) Received: from BAY131-W19 ([65.55.136.54]) by bay0-omc3-s37.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Thu, 12 Apr 2007 15:44:20 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_9d395dbb-805d-4433-a2c6-c6efdea7edac_" X-Originating-IP: [67.116.31.14] From: Karthikeyan Sundaram To: , Subject: question on plpgsql block Date: Thu, 12 Apr 2007 15:44:19 -0700 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 12 Apr 2007 22:44:20.0010 (UTC) FILETIME=[1BC700A0:01C77D54] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.711 tagged_above=0 required=5 tests=AWL=-0.954, BAYES_20=-0.74, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, HTML_40_50=0.496, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200704/124 X-Sequence-Number: 25188 --_9d395dbb-805d-4433-a2c6-c6efdea7edac_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Gurus, =20 I tried a plpgsql block from the php. =20 example=20 =20 a=3D'begin insert into table a values (....); insert into table b values (....) insert into table c values (...) select into p_var ... from table where condtion update a set column =3D where condition; commit; end;'; =20 I works fine when I call this block from php, whereas, I tried to copy = the same value from the command line prompt or PGadmin GUI utility. Then i= t says "ERROR: current transaction is aborted, commands ignored until end = of transaction block"=20 =20 Why? =20 Did we need to do any special step up to execute a block or blocks won't= execue from command line mode? Please advise. =20 Regards skarthi =20 =20 =20 _________________________________________________________________ Your friends are close to you.=A0Keep them that way. http://spaces.live.com/signup.aspx= --_9d395dbb-805d-4433-a2c6-c6efdea7edac_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Gurus,
 
    I tried a plpgsql block from the php.
 
    example
 
    a=3D'begin
      insert into table a values (....);
      insert into table b values (....)
     insert into table c values (...)
     select into p_var ... from table where condtion      update a set column =3D <new value> where co= ndition;
    commit;
    end;';
   
    I works fine when I call this block from php, whereas, I= tried to copy the same value from the command line prompt or PGadmin GUI u= tility.  Then it says "ERROR:  current transaction is aborted, co= mmands ignored until end of transaction block"
 
  Why?
 
   Did we need to do any special step up to execute a block or bl= ocks won't execue from command line mode? Please advise.
 
Regards
skarthi
 
 
 


Your friends are close to you.=A0 Keep them that way. = --_9d395dbb-805d-4433-a2c6-c6efdea7edac_-- From peter_e@gmx.net Thu Apr 12 23:38:54 2007 Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 45C879FBB96 for ; Thu, 12 Apr 2007 20:38:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85148-03 for ; Thu, 12 Apr 2007 20:38:53 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 4F3A79FBB91 for ; Thu, 12 Apr 2007 20:38:53 -0300 (ADT) Received: (qmail invoked by alias); 12 Apr 2007 23:38:51 -0000 Received: from xdsl-87-78-215-154.netcologne.de (EHLO colt.pezone.net) [87.78.215.154] by mail.gmx.net (mp054) with SMTP; 13 Apr 2007 01:38:51 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX19fEosApiJfjpp6nJ63Ew6LA2b+xTIBPOZK4WIHg8 fEdccs7AHM/p0/ From: Peter Eisentraut To: pgsql-admin@postgresql.org Subject: Re: question on plpgsql block Date: Fri, 13 Apr 2007 01:38:47 +0200 User-Agent: KMail/1.9.5 Cc: Karthikeyan Sundaram References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200704130138.48740.peter_e@gmx.net> X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/125 X-Sequence-Number: 25189 Karthikeyan Sundaram wrote: > I tried a plpgsql block from the php. plpgsql blocks only work in a plpgsql function. -- Peter Eisentraut http://developer.postgresql.org/~petere/ From andreas.kretschmer@schollglas.com Fri Apr 13 06:28:45 2007 Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 94D9E9FA59C for ; Fri, 13 Apr 2007 03:28:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 59734-10 for ; Fri, 13 Apr 2007 03:28:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.179]) by postgresql.org (Postfix) with ESMTP id DF8E99FB548 for ; Fri, 13 Apr 2007 03:28:41 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), id 0MKwh2-1HcFGy0zeB-0005i3; Fri, 13 Apr 2007 08:28:40 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1HcFGx-00070c-00 for pgsql-sql@postgresql.org; Fri, 13 Apr 2007 08:28:39 +0200 Date: Fri, 13 Apr 2007 08:28:39 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: question on plpgsql block Message-ID: <20070413062839.GB24558@a-kretschmer.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX1+t/SWz4yAKuQfObYiCmG32QgpItLZN6El9/Wa 6dSxD7Y9cMQBwycoFqJ/EX+4pClHBormt5dJj7Rh9TlSU4lauk Vh8oJq0PJpZNP4c1IhIamA6uUasmHmH X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/138 X-Sequence-Number: 28138 am Thu, dem 12.04.2007, um 15:44:19 -0700 mailte Karthikeyan Sundaram folgendes: > Hi Gurus, > > I tried a plpgsql block from the php. > > example > > a='begin > insert into table a values (....); > insert into table b values (....) > insert into table c values (...) > select into p_var ... from table where condtion > update a set column = where condition; > commit; > end;'; > > I works fine when I call this block from php, whereas, I tried to copy the > same value from the command line prompt or PGadmin GUI utility. Then it says > "ERROR: current transaction is aborted, commands ignored until end of > transaction block" > > Why? My guess: PHP treat each line separately and sends line by line to the server and adds the missing ';' if necessary. If you send this from the GUI the server received one big command with syntax-errors, because the missing ';' after some commands. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net