Behavior of parameter holders in query containing a '$1'

Поиск
Список
Период
Сортировка
От Eddy Hahn
Тема Behavior of parameter holders in query containing a '$1'
Дата
Msg-id 11BF774F-C6D5-40E7-9421-C54F047A1D4C@CREIGHTONEDWARD.COM
обсуждение исходный текст
Ответы Re: Behavior of parameter holders in query containing a '$1'  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Commitfest: The Good, The Bad, and the Ugly
Следующее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: huge difference in performance between MS SQL and pg 8.3 on UPDATE with full text search