Re: deparsing utility commands - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: deparsing utility commands
Date
Msg-id 20150820163558.GP5232@alvherre.pgsql
Whole thread Raw
In response to Re: deparsing utility commands  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
List pgsql-hackers
Shulgin, Oleksandr wrote:

> Another quirk of ALTER TABLE is that due to multi-pass processing in
> ATRewriteCatalogs, the same command might be collected a number of times.
> For example, in src/test/regress/sql/inherit.sql:
> 
> alter table a alter column aa type integer using bit_length(aa);
> 
> the "alter column type" then appears 4 times in the deparsed output as
> identical subcommands of a single ALTER TABLE command.

Yeah, I had a hack somewhere in the collection code that if the relation
ID was different from what was specified, then the command was ignored.
I removed that before commit because it seemed possible that for some
cases you actually want the command reported separately for each child.

I think our best option in this case is to ignore commands that are
reported for different relations during JSON deparsing.  Not sure how
easy that is.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: Declarative partitioning
Next
From: Kevin Burke
Date:
Subject: Annotating pg_dump/pg_restore