Re: [HACKERS] [SQL] Postgresql “alter column type” creates an event which contains “temp_table_xxx”

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] [SQL] Postgresql “alter column type” creates an event which contains “temp_table_xxx”
Дата
Msg-id 4792.1500992338@sss.pgh.pa.us
обсуждение исходный текст
Ответы [HACKERS] Re: [SQL] Postgresql “alter column type” creates an event which contains “temp_table_xxx”  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
Zehra Gül Çabuk <zgul.cabuk@gmail.com> writes:
>  => ALTER TABLE test ALTER COLUMN x TYPE integer USING
> (trim(x)::integer);ALTER TABLE
> Last command I've executed to alter column data type creates an event like
> this:
> BEGIN 500913table public.pg_temp_1077668: INSERT: x[integer]:14table
> public.pg_temp_1077668: INSERT: x[integer]:42COMMIT 500913
> How could I find "real" table name using this record? Is there any way to
> see real table name in fetched record?

That is the real name --- table rewrites create a table with a temporary
name and the desired new column layout, then fill it with data, then
exchange the data area with the old table, then drop the temp table.

Evidently logical decoding is exposing some of this infrastructure
to you.  I bet it isn't exposing the critical "swap data" step though,
so I wonder how exactly a logical decoding plugin is supposed to make
sense of what it can see here.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] cache lookup failed error for partition key with custom opclass
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] pl/perl extension fails on Windows