Re: Add FOREIGN to ALTER TABLE in pg_dump

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Luis Carril <luis(dot)carril(at)swarm64(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add FOREIGN to ALTER TABLE in pg_dump
Date: 2019-09-25 20:04:06
Message-ID: 20190925200405.GA22045@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2019-Jul-12, Luis Carril wrote:

> Hello,
> pg_dump creates plain ALTER TABLE statements even if the table is a foreign table, which for someone reading the dump is confusing.
> This also made a difference when applying the dump if there is any plugin installed that hooks on ProcessUtility, because the plugin could react differently to ALTER TABLE than to ALTER FOREIGN TABLE. Opinions?

I think such a hook would be bogus, because it would miss anything done
by a user manually.

I don't disagree with adding FOREIGN, though.

Your patch is failing the pg_dump TAP tests. Please use
configure --enable-tap-tests, fix the problems, then resubmit.

> An unrelated question: if I apply pgindent to a file (in this case pg_dump.c) and get a bunch of changes on the indentation that are not related to my patch, which is the accepted policy? A different patch first with only the indentation? Maybe, am I using pgindent wrong?

We don't typically accept pgindent-only changes at random points in
the devel cycle.

I would suggest to run pgindent over the file and "git add -p" only the
changes that are relevant to your patch, discard the rest.
(Alternative: run pgindent, commit that, then apply your patch, pgindent
again and "git commit --amend", then "git rebase -i" and discard the
first pgindent commit. Your patch ends up pgindent-correct without
disturbing the rest of the file/tree).

Álvaro Herrera
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-09-25 20:04:57 Re: [Patch] Add a reset_computed_values function in pg_stat_statements
Previous Message Andres Freund 2019-09-25 20:02:10 Re: Don't codegen deform code for virtual tuples in expr eval for scan fetch