]> granicus.if.org Git - postgresql/commit
A long time ago, Peter pointed out that ruleutils.c didn't dump simple
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 6 Jan 2008 01:03:46 +0000 (01:03 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 6 Jan 2008 01:03:46 +0000 (01:03 +0000)
commitec59b6deb8f5cee83d2f6f3155855a06c77a050c
tree062f9888b3d804be9d1abd5a73066f898c0a478a
parent56a2a4176389abdba65adf063fbfacf853a20132
A long time ago, Peter pointed out that ruleutils.c didn't dump simple
constant ORDER/GROUP BY entries properly:
http://archives.postgresql.org/pgsql-hackers/2001-04/msg00457.php
The original solution to that was in fact no good, as demonstrated by
today's report from Martin Pitt:
http://archives.postgresql.org/pgsql-bugs/2008-01/msg00027.php
We can't use the column-number-reference format for a constant that is
a resjunk targetlist entry, a case that was unfortunately not thought of
in the original discussion.  What we can do instead (which did not work
at the time, but does work in 7.3 and up) is to emit the constant with
explicit ::typename decoration, even if it otherwise wouldn't need it.
This is sufficient to keep the parser from thinking it's a column number
reference, and indeed is probably what the user must have done to get
such a thing into the querytree in the first place.
src/backend/utils/adt/ruleutils.c