From: Sergei Kornilov <sk@zsrv.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Ildar Musin <i.musin@postgrespro.ru>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: using index or check in ALTER TABLE SET NOT NULL
Date: Tue, 06 Mar 2018 22:27:40 +0300
Message-ID: <2091981520364460@web24g.yandex.ru> (raw)
In-Reply-To: <1142.1520362313@sss.pgh.pa.us>
References: <880511520351578@web5j.yandex.ru>
<20180306172528.xnelm3xcq2qeyd2g@alvherre.pgsql>
<1715451520361128@web26o.yandex.ru>
<1142.1520362313@sss.pgh.pa.us>
Hello
> Do you actually need test output proving that this code path was taken
> rather than the default one? Seems like looking at the code coverage
> report might be enough.
I not known. In v4 i use DEBUG1 message and do not check code path in tests at all: by full table scan or by constraint, i tested only command result to not break behavior.
Today Ildar Musin proposed to test code path through NotNullImpliedByRelConstraints function. This is my first patch and I do not have the confidence to write a test. So I looked more closely at the alter table tests, found several info in attach partition and updated my patch.
> I did not see any INFO messages in a quick test of ALTER TABLE ATTACH
> PARTITION, but if there are any lurking in there, they probably need
> to be downgraded.
In src/test/regress/expected/alter_table.out i found 7 test with
> INFO: partition constraint for table "..." is implied by existing constraints
and 5 with
> INFO: updated partition constraint for default partition "..." is implied by existing constraints
ereport's are in ValidatePartitionConstraints function src/backend/commands/tablecmds.c
regards, Sergei
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-hackers@postgresql.org
Cc: sk@zsrv.org, tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, i.musin@postgrespro.ru, sfrost@snowman.net, robertmhaas@gmail.com
Subject: Re: using index or check in ALTER TABLE SET NOT NULL
In-Reply-To: <2091981520364460@web24g.yandex.ru>
* 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