Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail
Дата
Msg-id 18303.1275666785@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail  ("Farid Zidan" <farid@zidsoft.com>)
Список pgsql-bugs
"Farid Zidan" <farid@zidsoft.com> writes:
> If you use keyword 'distinct' for the source select of the insert statement
> the insert fails. Insert succeeds if 'distinct' is not used in select list.

This isn't a bug, it's a consequence of the fact that you're not
specifying the types of the literal constants.  DISTINCT forces
the parser to assign a data type to the constants (otherwise there
is no way to understand what duplicate-elimination means) and what
it will fall back to is "text".  Try attaching an explicit cast,
eg
    '2010-04-30 00:00:00'::timestamp

            regards, tom lane

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

Предыдущее
От: "Farid Zidan"
Дата:
Сообщение: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail