Behavior of parameter holders in query containing a '$1' - Mailing list pgsql-general

From Eddy Hahn
Subject Behavior of parameter holders in query containing a '$1'
Date
Msg-id 11BF774F-C6D5-40E7-9421-C54F047A1D4C@CREIGHTONEDWARD.COM
Whole thread Raw
Responses Re: Behavior of parameter holders in query containing a '$1'  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi,

1) I'm reading the API documentation and I'm wondering how the client library would handle the following statement

INSERT INTO test (value1, value2) VALUES ('$1', $1)

Would it handle it incorrectly and would think that '$1' is the parameter or would it skip it because it know that it's
astring value encapsulated in ''? 

2) Can $1 be used more then one times for example if you want to use the same value for multiple column value?
UPDATE test set value1=$1,value2=$1

Thanks,

Eddy



pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Commitfest: The Good, The Bad, and the Ugly
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: huge difference in performance between MS SQL and pg 8.3 on UPDATE with full text search