Re: BUG #3271: PREPARE/EXCUTE don't work - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #3271: PREPARE/EXCUTE don't work
Date
Msg-id 46449180.1040302@enterprisedb.com
Whole thread Raw
In response to BUG #3271: PREPARE/EXCUTE don't work  ("laurent faillie" <l_faillie@yahoo.com>)
Responses RE : Re: BUG #3271: PREPARE/EXCUTE don't work  (Laurent FAILLIE <l_faillie@yahoo.com>)
List pgsql-bugs
laurent faillie wrote:
> While trying to use Apache 2.2 database authentication, I discovered that I
> wasn't able to retrieve users. After some investigation, I found that
> PREPARE/EXECUTE are faulty. It can be reproduced in psql as bellow :
>
> www=> PREPARE authn_dbd_1 (varchar) AS select mdp from mariage.comptes where
> nom = '$1';

That $1 should be without the quotes, like this:

PREPARE authn_dbd_1 (varchar) AS select mdp from mariage.comptes where
nom = $1

Otherwise the query looks for a user named '$1'.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: "laurent faillie"
Date:
Subject: BUG #3271: PREPARE/EXCUTE don't work
Next
From: Bruno Wolff III
Date:
Subject: Re: BUG #3270: limit < 16 optimizer behaviour