Re: Failure to coerce unknown type to specific type

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Failure to coerce unknown type to specific type
Дата
Msg-id 1428560300.2845.45.camel@jeff-desktop
обсуждение исходный текст
Ответ на Re: Failure to coerce unknown type to specific type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Wed, 2015-04-08 at 21:31 -0400, Tom Lane wrote:
> Jeff Davis <pgsql@j-davis.com> writes:
> > Original report and patch by Karl Schnaitter.
> > create table a(u) as select '1';
>
> We should, in fact, fail that to begin with.  Unknown-type columns are
> a spectactularly horrid idea.

That example was just for illustration. My other example didn't require
creating a table at all:

  SELECT a=b FROM (SELECT ''::text, '  ') x(a,b);

it's fine with me if we want that to fail, but I don't think we're
failing in the right place, or with the right error message.

I'm not clear on what rules we're applying such that the above query
should fail, but:

  SELECT ''::text='  ';

should succeed. Unknown literals are OK, but unknown column references
are not? If that's the rule, can we catch that earlier, and throw an
error like 'column reference "b" has unknown type'?

Regards,
    Jeff Davis

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Failure to coerce unknown type to specific type
Следующее
От: eshkinkot@gmail.com
Дата:
Сообщение: BUG #13010: After promote postgres try to send old timeline WALs to archive