| От | Tom Lane |
|---|---|
| Тема | Re: leaving out paramTypes parameter |
| Дата | |
| Msg-id | 9625.1155569002@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | leaving out paramTypes parameter (Andro <andromede@gmail.com>) |
| Список | pgsql-interfaces |
Andro <andromede@gmail.com> writes:
> they both require "paramTypes" parameter, but documentation says "If
> paramTypes is NULL, or any particular element in the array is zero,
> the server assigns a data type to the parameter symbol in the same way
> it would do for an untyped literal string."
> How reliable is that? Can we really leave out this parameter anytime?
Like it says, you get the same results you would get from writing a
literal string 'foo' where the parameter symbol is. If you like,
you can force the type decision with a cast in the query text, eg
"SELECT ... WHERE x = $1::int8 ... "
In some ways this is better than using paramTypes because you don't
have to mess with numeric OIDs for data types.
regards, tom lane
В списке pgsql-interfaces по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера