From cd902b331dc4b0c170e800441a98f9213d98b46b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 9 May 2008 23:32:05 +0000 Subject: Change the rules for inherited CHECK constraints to be essentially the same as those for inherited columns; that is, it's no longer allowed for a child table to not have a check constraint matching one that exists on a parent. This satisfies the principle of least surprise (rows selected from the parent will always appear to meet its check constraints) and eliminates some longstanding bogosity in pg_dump, which formerly had to guess about whether check constraints were really inherited or not. The implementation involves adding conislocal and coninhcount columns to pg_constraint (paralleling attislocal and attinhcount in pg_attribute) and refactoring various ALTER TABLE actions to be more like those for columns. Alex Hunsaker, Nikhil Sontakke, Tom Lane --- src/include/nodes/parsenodes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/include/nodes/parsenodes.h') diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 61c3df53913..0875b99a224 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.364 2008/04/29 20:44:49 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.365 2008/05/09 23:32:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -892,11 +892,11 @@ typedef enum AlterTableType AT_AddIndex, /* add index */ AT_ReAddIndex, /* internal to commands/tablecmds.c */ AT_AddConstraint, /* add constraint */ + AT_AddConstraintRecurse, /* internal to commands/tablecmds.c */ AT_ProcessedConstraint, /* pre-processed add constraint (local in * parser/parse_utilcmd.c) */ AT_DropConstraint, /* drop constraint */ - AT_DropConstraintQuietly, /* drop constraint, no error/warning (local in - * commands/tablecmds.c) */ + AT_DropConstraintRecurse, /* internal to commands/tablecmds.c */ AT_AlterColumnType, /* alter column type */ AT_ChangeOwner, /* change owner */ AT_ClusterOn, /* CLUSTER ON */ -- cgit v1.2.3