Re: Invalid statement name (null) in line ## - what am I doing wrong ?

From: Martin Gainty <mgainty(at)hotmail(dot)com>
To: <leif(at)crysberg(dot)dk>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Invalid statement name (null) in line ## - what am I doing wrong ?
Date: 2009-06-19 01:57:27
Message-ID: BLU142-W236039C4D0EB6ADBF9BA83AE3A0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


can we see the original statement ?

can you combine the 2 statements to produce the necessary cursor
OPEN curs1 FOR EXECUTE 'SELECT * FROM ' || quote_ident($1);http://www.postgresql.org/docs/8.1/interactive/plpgsql-cursors.html

takk
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

> Date: Fri, 19 Jun 2009 03:08:35 +0200
> From: leif(at)crysberg(dot)dk
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] Invalid statement name (null) in line ## - what am I doing wrong ?
>
> Hi,
>
> I have a problem when upgrading from 8.2.4 to 8.3/8.4 using ecpg with a prepare statement:
>
> EXEC SQL PREPARE execquery FROM :stmt; line = __LINE__;
> EXEC SQL AT :_thisDbConn DECLARE execcurs CURSOR FOR execquery; line = __LINE__;
> EXEC SQL AT :_thisDbConn OPEN execcurs; line = __LINE__;
> EXEC SQL ALLOCATE DESCRIPTOR execdesc; line = __LINE__;
>
> I get an "SQL error: invalid statement name "(null)" on line ##" (3rd line above) on the OPEN cursor statement. I have been digging a little in the ecpg output and noticed that the format of the ECPGprepare() function call has changed between 8.2.4 and 8.3++. Also the ecpg library has changed version libecpg.so.5 -> libecpg.so.6.
>
> I am compiling my program on an (older) system with 8.2.4 installed and I need have my program running on a production system running 8.3.5 or higher. This seems to work fine, but for other reasons I wanted to upgrade my "compile system" with 8.3.5 and this started to give me the error mentioned above.
>
> An ldd on the program gives:
>
> libecpg.so.6 => /usr/local/Packages/pgsql-8.3.5/lib/libecpg.so.6 (0xb7ed8000)
> libpq.so.5 => /usr/local/Packages/pgsql-8.3.5/lib/libpq.so.5 (0xb7ebc000)
>
> which looks to be ok. (The 8.2.4 compiled program was using libecpg.so.5.)
>
> It seems to me that somehow the prepare statement (first line above) is compiled into a ECPGprepare() call with 5 parameters, but using a library function with only 3 parameters, even though it points to the libecpg.so.6, which includes code having the 5 parameter ECPGprepare() function.
>
> All PostgreSQL systems are natively installed from source on the various systems, i.e. compiled individually on each system. All my systems are running Linux, but with different versions of Linux.
>
> I have also tried the very newest version 8.4rc1, but with same result, the error above.
>
> Please help,
>
> Leif
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

_________________________________________________________________
Microsoft brings you a new way to search the web. Try Bing™ now
http://www.bing.com?form=MFEHPG&publ=WLHMTAG&crea=TEXT_MFEHPG_Core_tagline_try bing_1x1

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Postgres User 2009-06-19 02:03:52 Maintaining user roles and permissions in Postgres - general question
Previous Message Craig Ringer 2009-06-19 01:38:09 Re: postgresql-8.3.7 unexpected connection closures