Skip site navigation (1) Skip section navigation (2)

Fix ecpg SQL CONNECT with variable user name

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-patches(at)postgresql(dot)org
Subject: Fix ecpg SQL CONNECT with variable user name
Date: 2007-12-28 02:43:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Here is a fix for ecpg in 8.3 when the user name is specified by
variables on SQL CONNECT.

When we compile the following statement in ecpg:
    EXEC SQL CONNECT TO :dbname USER :usrname IDENTIFIED BY :usrpass;

ecpg in 8.2 compiles it correctly.
    { ECPGconnect(__LINE__, 0, dbname , usrname , usrpass , NULL, 0); }

but ecpg in 8.3beta4 returns wrong results.
    { ECPGconnect(__LINE__, 0, dbname , " $1 " , " $2 " , NULL, 0); }

It seems to come from the change of create_questionmarks() in

Variables are represented as "$%d" instead of "?" now.
The grammer of "user_name" should have followed the change.

ITAGAKI Takahiro
NTT Open Source Software Center

Attachment: ecpg-connect.patch
Description: application/octet-stream (444 bytes)


pgsql-patches by date

Next:From: Andrew DunstanDate: 2007-12-28 04:14:38
Subject: Re: [HACKERS] Unworkable column delimiter characters for COPY
Previous:From: Tom LaneDate: 2007-12-27 23:54:15
Subject: Re: Archiver behavior at shutdown

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group