Re: plpgsql - variable's names conflict with table field names
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: plpgsql - variable's names conflict with table field names |
| Дата | |
| Msg-id | 10330.1077030076@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | plpgsql - variable's names conflict with table field names (Pavel Stehule <stehule@kix.fsv.cvut.cz>) |
| Ответы |
Re: plpgsql - variable's names conflict with table field
|
| Список | pgsql-bugs |
Pavel Stehule <stehule@kix.fsv.cvut.cz> writes:
> When I declare variable with same name as field of table, then I
> have a problem with insert cmd in plpgsql procedure.
Don't do that.
> Is it plpgsql error or my bug?
You could argue it either way, perhaps, but it's unlikely to get
changed. In general plpgsql cannot tell whether a variable name
appearing in a SQL command ought to be substituted for or not, and so it
just always does it. I think trying to be smart would create as many
pitfalls as it'd solve. The best practice is not to use plpgsql
variable names that match table or field names you need to access in the
same procedure.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера