Re: Why no CONSTANT for row variables in plpgsql?
От | Jim Nasby |
---|---|
Тема | Re: Why no CONSTANT for row variables in plpgsql? |
Дата | |
Msg-id | 56256BB6.6010902@BlueTreble.com обсуждение исходный текст |
Ответ на | Re: Why no CONSTANT for row variables in plpgsql? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Why no CONSTANT for row variables in plpgsql?
|
Список | pgsql-hackers |
On 10/18/15 10:16 PM, Tom Lane wrote: > Jim Nasby <Jim.Nasby@BlueTreble.com> writes: >> Is there a particular reason why row and record variables can't be >> CONSTANT in plpgsql? > > Well, you can't usefully do anything with such a variable unless > it can be initialized, which isn't currently supported either: > > regression=# do $$ declare x int8_tbl := row(1,2); begin end $$; > ERROR: default value for row or record variable is not supported > LINE 1: do $$ declare x int8_tbl := row(1,2); begin end $$; Yeah, I assumed the two were related. We also don't allow NOT NULL. This is all checked in the production in pl_gram.y, but there's nothing indicating why this is the case. :/ > I have a vague recollection of having looked at this a few years > ago and realizing it wasn't quite as trivial as one could wish. > Don't remember why, though. In any case, I'm sure it's fixable > if someone wants to put in enough effort. Yeah, was hoping someone knew offhand why this was a problem. Guess I'll rip the checks out and see what explodes. :) -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com
В списке pgsql-hackers по дате отправления: