| От | Tom Lane |
|---|---|
| Тема | Re: Inconsistent behavior with unnamed columns |
| Дата | |
| Msg-id | 43044.1380576812@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Inconsistent behavior with unnamed columns (David Johnston <polobo@yahoo.com>) |
| Список | pgsql-general |
David Johnston <polobo@yahoo.com> writes:
> Moshe Jacobson wrote
>> Why does bool get special treatment?
>>
>> postgres# select 'abc', 1, false;
>> ?column? | ?column? | bool
>> ----------+----------+------
>> abc | 1 | f
>> (1 row)
> It doesn't (at least not as I see things in my client/version - noted
> below):
> *SELECT 'abc'::text;*
> If the type is known the type is used for the column header but since 'abc'
> and 1 do not have types this does not work.
A look into gram.y shows that "false" is parsed as 'f'::bool, so the
default column header name comes from that cast. See also FigureColname()
in parser/parse_target.c, which embodies the heuristics for choosing a
default column name for an expression.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера