Re: [GENERAL] Bug with sequences in 6.4.2

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [GENERAL] Bug with sequences in 6.4.2
Дата
Msg-id 199903151555.KAA14357@candle.pha.pa.us
обсуждение исходный текст
Ответы Re: [HACKERS] Re: [GENERAL] Bug with sequences in 6.4.2  (reedstrm@wallace.ece.rice.edu (Ross J. Reedstrom))
Re: [HACKERS] Re: [GENERAL] Bug with sequences in 6.4.2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Oleg Broytmann
Дата:
Сообщение: Re: [HACKERS] VACUUM ANALYZE problem on linux
Следующее
От: jwieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] libpq and SPI