CURRENT/OLD keywords still broken
peter=# select 1 as current;
old
-----
1
This is now the inverse of what it used to do, but it's still not what it
*should* do. I see someone already tried to fix that (keywords.c 1.76 ->
1.77, TODO list), but he should try again.
--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/
peter=# select 1 as current;
old
-----
1This is now the inverse of what it used to do, but it's still not what it
*should* do. I see someone already tried to fix that (keywords.c 1.76 ->
1.77, TODO list), but he should try again.
That was me. The old code did old -> current, so I changed it to do
current -> old. How else can I fix this? Attached is the old patch.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Attachments:
/bjm/difftext/plainDownload+8-6
Peter Eisentraut <peter_e@gmx.net> writes:
peter=# select 1 as current;
old
-----
1
This is now the inverse of what it used to do, but it's still not what it
*should* do. I see someone already tried to fix that (keywords.c 1.76 ->
1.77, TODO list), but he should try again.
We should rip out the whole current/old aliasing, IMHO. CURRENT has
been unsupported for a version or two now, hasn't it?
I had that on my personal TODO list, but I was going to leave it till
after 7.1 because I had mistakenly thought that CURRENT was still a
keyword in 7.0. But it wasn't, was it? Bruce, why did you put in
that mapping?
regards, tom lane
Bruce Momjian <pgman@candle.pha.pa.us> writes:
That was me. The old code did old -> current, so I changed it to do
current -> old. How else can I fix this? Attached is the old patch.
But CURRENT was strictly an internal token name, not a string the user
could actually see. So there's no need to have
+ /* for portability with old rules bjm 2000-06-12 */
+ {"current", OLD},
The only way that there would be a compatibility problem would be if
ruleutils.c had been set up to print CURRENT, but it wasn't:
*** 1278,1284 ****
quote_identifier(rte->relname));
else if (!strcmp(rte->ref->relname, "*NEW*"))
appendStringInfo(buf, "new.");
! else if (!strcmp(rte->ref->relname, "*CURRENT*"))
appendStringInfo(buf, "old.");
else
appendStringInfo(buf, "%s.",
--- 1278,1284 ----
quote_identifier(rte->relname));
else if (!strcmp(rte->ref->relname, "*NEW*"))
appendStringInfo(buf, "new.");
! else if (!strcmp(rte->ref->relname, "*OLD*"))
appendStringInfo(buf, "old.");
else
NEW and OLD are what the user see, and have been for awhile. So there's
no compatibility issue here.
regards, tom lane
OK, compatibility mapping removed.
Bruce Momjian <pgman@candle.pha.pa.us> writes:
That was me. The old code did old -> current, so I changed it to do
current -> old. How else can I fix this? Attached is the old patch.But CURRENT was strictly an internal token name, not a string the user could actually see. So there's no need to have + /* for portability with old rules bjm 2000-06-12 */ + {"current", OLD},The only way that there would be a compatibility problem would be if
ruleutils.c had been set up to print CURRENT, but it wasn't:*** 1278,1284 **** quote_identifier(rte->relname)); else if (!strcmp(rte->ref->relname, "*NEW*")) appendStringInfo(buf, "new."); ! else if (!strcmp(rte->ref->relname, "*CURRENT*")) appendStringInfo(buf, "old."); else appendStringInfo(buf, "%s.", --- 1278,1284 ---- quote_identifier(rte->relname)); else if (!strcmp(rte->ref->relname, "*NEW*")) appendStringInfo(buf, "new."); ! else if (!strcmp(rte->ref->relname, "*OLD*")) appendStringInfo(buf, "old."); elseNEW and OLD are what the user see, and have been for awhile. So there's
no compatibility issue here.regards, tom lane
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Bruce Momjian writes:
peter=# select 1 as current;
old
-----
1This is now the inverse of what it used to do, but it's still not what it
*should* do. I see someone already tried to fix that (keywords.c 1.76 ->
1.77, TODO list), but he should try again.That was me. The old code did old -> current, so I changed it to do
current -> old. How else can I fix this? Attached is the old patch.
Maybe add another branch into the SpecialRuleRelation grammar rule with
CURRENT instead of OLD.
--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/