Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.
Дата
Msg-id 792E8C73-EBE0-41FC-A83F-2F7A7AF4ABBB@yesql.se
обсуждение исходный текст
Ответ на BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17486: [pg_restore] Restoring a view fails if this view contains an attribute without alias name.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
> On 19 May 2022, at 14:03, PG Bug reporting form <noreply@postgresql.org> wrote:

> I found something weird. Restoring a view fails if this view contains an
> attribute without alias name.

This is not unique to 14, it can be reproduced further down as well.

>    pg_restore: error: could not execute query: ERROR:  column
> static_select.?column? does not exist
>    LINE 7:     static_select."?column?"
>            ^
>    Command was: CREATE VIEW public.v_static_select AS
>     WITH static_select AS (
>         SELECT 1 AS foo,
>            'text'::text
>        )
>     SELECT static_select.foo,
>        static_select."?column?"
>       FROM static_select;

Since there is no column name given, FigureColname() will do its best to figure
something out and the typecast to TEXT added will lead it to chose the column
type as the column name.  This will lead the qualified "?column?" target col in
the view query to not resolve.  When creating the view the ::text explicit cast
is added after column names are resolved so this only breaks on restoring the
view definition for the expanded SELECT *.

--
Daniel Gustafsson        https://vmware.com/




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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Implicitly created operator family not listed by pg_event_trigger_ddl_commands
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17490: unconsistency between TRUNCATE RESTART IDENTITY and setval()