Thread

  1. BUG #1178: PQexecPrepared - PostgreSQL 7.4.1

    PostgreSQL Bugs List <pgsql-bugs@postgresql.org> — 2004-06-22T15:34:19Z

    The following bug has been logged online:
    
    Bug reference:      1178
    Logged by:          Theo Kramer
    
    Email address:      theo@flame.co.za
    
    PostgreSQL version: 7.4
    
    Operating system:   Redhat Linux 9
    
    Description:        PQexecPrepared - PostgreSQL 7.4.1
    
    Details: 
    
    I am having a problem with PQexecPrepared() as follows (derived from 
    testlibpq3.c) 
    
    PQexec(conn, 
       "PREPARE S0000123_000 (text) AS SELECT * from test1 WHERE t = $1");
    
    When invoking PQexecPrepared() I get the following message from the backend
    
    ERROR:  prepared statement "S0000123_0000" does not exist
    
    Yet if I use 
    
    PQexec(conn, "EXECUTE S0000123_0000 ('ho there')");
    
    instead of PQexecPrepared() then all works perfectly.
    
    Sounds like a bug to me...?
    
    
    
  2. Re: BUG #1178: PQexecPrepared - PostgreSQL 7.4.1

    Tom Lane <tgl@sss.pgh.pa.us> — 2004-06-22T17:23:38Z

    "PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
    > PQexec(conn, 
    >    "PREPARE S0000123_000 (text) AS SELECT * from test1 WHERE t = $1");
    > When invoking PQexecPrepared() I get the following message from the backend
    > ERROR:  prepared statement "S0000123_0000" does not exist
    
    Case sensitivity.  PQexecPrepared takes its name argument literally,
    but anything inside a SQL command will get downcased unless quoted.
    So you actually prepared "s0000123_000".
    
    			regards, tom lane
    
    
  3. Re: BUG #1178: PQexecPrepared - PostgreSQL 7.4.1

    Theo Kramer <theo@flame.co.za> — 2004-06-24T13:42:46Z

    On Tue, 2004-06-22 at 19:23, Tom Lane wrote:
    > "PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
    > > PQexec(conn, 
    > >    "PREPARE S0000123_000 (text) AS SELECT * from test1 WHERE t = $1");
    > > When invoking PQexecPrepared() I get the following message from the backend
    > > ERROR:  prepared statement "S0000123_0000" does not exist
    > 
    > Case sensitivity.  PQexecPrepared takes its name argument literally,
    > but anything inside a SQL command will get downcased unless quoted.
    > So you actually prepared "s0000123_000".
    > 
    
    Many thanks - perhaps a gotcha in the documentation for PQexecPrepared()
    would useful...
    
    Regards
    Theo