Re: [HACKERS] I think we need an explicit parsetree node for CAST

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] I think we need an explicit parsetree node for CAST
Дата
Msg-id 200001162204.RAA00798@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] I think we need an explicit parsetree node for CAST  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> > Yes, and constants with cases in SELECT INTO are broken too.
> 
> Huh?  I'm not sure if I follow this or not --- would you give an
> example?

Here is the mail I sent out last night.  It shows a failure:

---------------------------------------------------------------------------

I see your issue, and I don't know the code well enough to comment on
it.

I was able to do:
       test=> select 'x' as fred into test ;       NOTICE:  Attribute 'fred' has an unknown type               Relation
created;continue       SELECT       test=> \d test               Table "test"        Attribute |  Type   | Extra
-----------+---------+-------       fred      | unknown |
 

---------------------------------------------------------------------------

       test=> select 'x'::varchar as fred into test ;       SELECT       test=> \d test                 Table "test"
   Attribute |    Type    | Extra       -----------+------------+-------        fred      | varchar(0) |
 


Seems we should disallow this.  This last one is the one you want to
fix:

---------------------------------------------------------------------------

       test=> select 'x'::varchar(20) as fred into test ;       SELECT       test=> \d test                 Table
"test"       Attribute |    Type    | Extra       -----------+------------+-------        fred      | varchar(0) |
 

-
--  Bruce Momjian                        |  http://www.op.net/~candle 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,
Pennsylvania19026
 


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] I think we need an explicit parsetree node for CAST
Следующее
От: Alfred Perlstein
Дата:
Сообщение: docs done Re: [HACKERS] LIBPQ patches ...