From: Petr Jelinek <petr@2ndquadrant.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: xi@resolvent.net, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: BUG #13126: table constraint loses its comment
Date: Fri, 03 Jul 2015 16:59:57 +0200
Message-ID: <5596A36D.4030008@2ndquadrant.com> (raw)
In-Reply-To: <CAB7nPqRXLGYh4HZbW2_m5kJNjNtnt1zwAndkZGRdHuaj7d-jHQ@mail.gmail.com>
References: <20150422154850.5198.26685@wrigleys.postgresql.org>
<8519.1429995948@sss.pgh.pa.us>
<CAB7nPqT5dzkfYBwaz-NnojU8-aQNGas1P=AQBa9n9hg8mjv+hg@mail.gmail.com>
<CAB7nPqRk+Y_agaYWtjyQtghGL_m8_PSER=d85E2yvhtY3sh0ug@mail.gmail.com>
<559547A2.2000204@2ndquadrant.com>
<CAB7nPqRXLGYh4HZbW2_m5kJNjNtnt1zwAndkZGRdHuaj7d-jHQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 2015-07-03 15:50, Michael Paquier wrote:
> On Thu, Jul 2, 2015 at 11:16 PM, Petr Jelinek <petr@2ndquadrant.com> wrote:
>> I was going through the code and have few comments:
>> - Why do you change the return value of TryReuseIndex? Can't we use reuse
>> the same OidIsValid(stmt->oldNode) check that ATExecAddIndex is doing
>> instead?
>
> As pointed out by Heikki previously, that is actually unnecessary,
> comments are still lost even if the index is reused for constraints.
> So perhaps for simplicity we could just unconditionally recreate the
> comments all the time if they are available.
>
Ah ok, I missed Heikki's email.
>> - I think the changes to ATPostAlterTypeParse should follow more closely the
>> coding of transformTableLikeClause - namely use the idxcomment
>
> I am not sure I follow here. Could you elaborate?
>
Well for indexes you don't really need to add the new AT command, as
IndexStmt has char *idxcomment which it will automatically uses as
comment if not NULL. While I am not huge fan of the idxcomment it
doesn't seem to be easy to remove it in the future and it's what
transformTableLikeClause uses so it might be good to be consistent with
that.
--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: petr@2ndquadrant.com, michael.paquier@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
Subject: Re: BUG #13126: table constraint loses its comment
In-Reply-To: <5596A36D.4030008@2ndquadrant.com>
References: <20150422154850.5198.26685@wrigleys.postgresql.org> <8519.1429995948@sss.pgh.pa.us> <CAB7nPqT5dzkfYBwaz-NnojU8-aQNGas1P=AQBa9n9hg8mjv+hg@mail.gmail.com> <CAB7nPqRk+Y_agaYWtjyQtghGL_m8_PSER=d85E2yvhtY3sh0ug@mail.gmail.com> <559547A2.2000204@2ndquadrant.com> <CAB7nPqRXLGYh4HZbW2_m5kJNjNtnt1zwAndkZGRdHuaj7d-jHQ@mail.gmail.com> <5596A36D.4030008@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox