agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: Zehra Gül Çabuk <zgul.cabuk@gmail.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [SQL] Postgresql “alter column type” creates an event which contains “temp_table_xxx”
Date: Tue, 25 Jul 2017 10:18:58 -0400
Message-ID: <4792.1500992338@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJsoEnNqNmgmmZ3PBvtyRF_GhN2ypW3GkxqE9p9soDhc31n53A@mail.gmail.com>
References: <CAJsoEnNqNmgmmZ3PBvtyRF_GhN2ypW3GkxqE9p9soDhc31n53A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
=?UTF-8?B?WmVocmEgR8O8bCDDh2FidWs=?= <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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
view thread (3+ messages) latest in thread
Message-ID: <4792.1500992338@sss.pgh.pa.us>
Permalink: ../4792.1500992338@sss.pgh.pa.us/
Also on: postgresql.org/message-id/4792.1500992338@sss.pgh.pa.us
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, zgul.cabuk@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [SQL] Postgresql “alter column type” creates an event which contains “temp_table_xxx”
In-Reply-To: <4792.1500992338@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox