pgsql: Increase test coverage in RI_FKey_pk_upd_check_required()

Started by Peter Eisentrautover 7 years ago3 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Increase test coverage in RI_FKey_pk_upd_check_required()

This checks the case where the primary key has at least one null
column.

Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com>
Reviewed-by: Mi Tar <mmitar@gmail.com>
Discussion: /messages/by-id/7ae17c95-0c99-d420-032a-c271f510112b@2ndquadrant.com/

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cdaf4a472776141899dfdb742c9b73581f19f59a

Modified Files
--------------
src/test/regress/expected/foreign_key.out | 24 ++++++++++++++++++++++++
src/test/regress/sql/foreign_key.sql | 19 +++++++++++++++++++
2 files changed, 43 insertions(+)

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Peter Eisentraut (#1)
Re: pgsql: Increase test coverage in RI_FKey_pk_upd_check_required()

On Wednesday, January 16, 2019, Peter Eisentraut <peter@eisentraut.org>
wrote:

Increase test coverage in RI_FKey_pk_upd_check_required()

This checks the case where the primary key has at least one null
column.

Sorry if this seems pedantic but you are testing where a unique index has
at least one null column value. A primary key, per the docs, cannot
contain null in any of its columns. I read the commit message and thought
maybe that had changed while I wasn’t looking...

David J.

#3Peter Eisentraut
peter_e@gmx.net
In reply to: David G. Johnston (#2)
Re: pgsql: Increase test coverage in RI_FKey_pk_upd_check_required()

On 16/01/2019 17:39, David G. Johnston wrote:

On Wednesday, January 16, 2019, Peter Eisentraut <peter@eisentraut.org
<mailto:peter@eisentraut.org>> wrote:

Increase test coverage in RI_FKey_pk_upd_check_required()

This checks the case where the primary key has at least one null
column.

Sorry if this seems pedantic but you are testing where a unique index
has at least one null column value.  A primary key, per the docs, cannot
contain null in any of its columns.  I read the commit message and
thought maybe that had changed while I wasn’t looking...

Yeah, it's the foreign key referencing the primary key in this case.

You are correct, the message is a bit wrong.

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