Re: [HACKERS] Re: [GENERAL] Bug with sequences in 6.4.2

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Re: [GENERAL] Bug with sequences in 6.4.2
Дата
Msg-id 199903160432.XAA01411@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Re: [GENERAL] Bug with sequences in 6.4.2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> That would create an ambiguity that is better avoided.  I think nextval
> ought to duplicate the parser's behavior --- if possible, actually call
> the same routine the parser uses for looking up a sequence name.
> I suggest that it operate like this:
> 
> (1)    nextval('AA')        operates on sequence aa
> 
>     AA is lowercased, same as unquoted AA would be by the parser.
> 
> (2)    nextval('"AA"')        operates on sequence AA
> 
>     Quoted "AA" is treated as AA, same as parser would do it.
> 
> This should be fully backward compatible with existing SQL code, since
> the existing nextval() code implements case (1).  I doubt anyone has
> tried putting double quotes into their nextval arguments, so adding
> the case (2) behavior shouldn't break anything.

Good idea.  Done.

test=> select nextval('"Aa"');
nextval
-------     3
(1 row)



--  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 по дате отправления:

Предыдущее
От: Vadim Mikheev
Дата:
Сообщение: Re: [HACKERS] Sequences....
Следующее
От: Vadim Mikheev
Дата:
Сообщение: Re: [HACKERS] Re: [GENERAL] Bug with sequences in 6.4.2