Re: [GENERAL] Bug with sequences in 6.4.2

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: wehner(at)digital-security(dot)com (Stefan Wehner)
Cc: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: Re: [GENERAL] Bug with sequences in 6.4.2
Date: 1999-03-15 15:55:53
Message-ID: 199903151555.KAA14357@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> Greetings,
> there seems to be a slight bug in the parsing of the
> nextval function, tested under 6.4.2.
> It affects also the SERIAL type.
>
> Symptom :
>
> CREATE SEQUENCE "AA";
> -- Correct, quoted identifier is allowed;
> SELECT NEXTVAL('AA');
> --Produces Error
> --aa.nextval: sequence does not exist
>

Let me comment on this. In the first statement, "AA" is used in an
SQL command, and we handle this correctly. In the second case, NEXTVAL
is a function, called with a string.

Now in parse_func.c, we convert 'AA' to lower to try and find the
sequence table. My assumption is that we should attempt to find the
table without doing a lower(), and if that fails, try lower.

Does that make sense to people. We can't just lower it in every case.

>
> Probable source of problem, the Argument to nextval is
> not handled correctly as an Table Identifier.
>
> E.g. nextval('"AA"') is generates
> "aa".nextval: sequence does not exist
>
> Note the lowercase between the quotes.
>
> I quickly browsed the sources, but have not found the
> place where the conversion to lowercase occurs.
>
> Please check this against 6.5 and 6.4.3 too.
>
> With Regards,
> Stefan Wehner
>
>
>
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Walker 1999-03-15 16:29:29 Re: [GENERAL] Soundex functions for triggers?
Previous Message Roderick A. Anderson 1999-03-15 15:43:53 Soundex functions for triggers?

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-03-15 16:04:21 Re: [HACKERS] libpq and SPI
Previous Message Oleg Broytmann 1999-03-15 15:51:32 Re: [HACKERS] VACUUM ANALYZE problem on linux