Re: [GENERAL] Bug with sequences in 6.4.2

From: wehner(at)digital-security(dot)com (Stefan Wehner)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Bug with sequences in 6.4.2
Date: 1999-03-11 17:08:16
Message-ID: 19990311170816.4853D1518F@miraculix.shw.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,
I have found the place from which this bug seems to originate in
[6.4.2 sources]
backend/parser/parse_func.c
line #443 - #445

There is the call to
text *lower(text *)

so probably any fix should start here.
Now what is the intended semantics/syntax for nextval(<ARG>) ?

e.g.
a) nextval('AA'),
b) nextval("AA")
or even
c) nextval('"AA"')

a change to allow syntax a) might have the potential to break existing
assumptions about case-insensitiveness on behalf of nextval,
I would prefer a change that would allow
nextval(aa) -- This will cause problems in the parser as a syntactic
-- element is removed
nextval("AA")
something around this line of thought will make handling of identifiers
consistent again. Treat a string case-insensitive unless it is a quoted
identifier.
I had expected the ugly c) above to work, but currently there is no check if
the sequencename might be a quoted identifier.
I'm not sure if I have enough time to make a patch myself, as I'm not overly
confident to find my way through the intestines of the parser, but maybe one
of you can either think of a quick fix or point me to what needs to be
considered to implement a fix.

BTW, as this affects SERIAL, I consider this a definite showstopper for both
6.4.x and 6.5 ( that is if it is still present in there ).

Test Case from my earlier post should probably go into the Regress tests ASAP.

With Regards,
Stefan Wehner

Browse pgsql-general by date

  From Date Subject
Next Message Ralf Weidemann 1999-03-11 20:48:24 daily check for expired data ?
Previous Message Tom Lane 1999-03-11 15:14:10 Re: [INTERFACES] threads and libpq