Hi all. My name is Jose Arthur and I use PostgreSQL for a while, but never contributed to the main project, until now.
Since nobody else take this patch to review in this commitfest, I'm going to try :-). The main problem can be found here: http://archives.postgresql.org/pgsql-hackers/2009-11/msg00146.php How to simulate: CREATE TABLE foo(id integer NOT NULL, val text NOT NULL); CREATE TABLE foo2(another_id integer NOT NULL) INHERITS(foo); ALTER TABLE foo2 ALTER COLUMN val DROP NOT NULL; insert into foo2 values (1, null, 1); Then pg_dump > dump.pgsql and psql -f dump.pgsql I've applied the patch submitted here: http://archives.postgresql.org/pgsql-hackers/2010-09/msg00763.php against current master (635de8365f0299cfa2db24c56abcfccb65d020f0) and compile is fine Using the patch, I can't drop NOT NULL from foo2, just from foo, and I think that makes sense: postgres=# ALTER TABLE foo2 ALTER COLUMN val DROP NOT NULL; ERROR: cannot drop inherited NOT NULL constraint "foo2_val_not_null", relation "foo2" One thing that I take notice is when you create a simple table like this one: select count(*) from pg_constraint ; 12 rows appears in pg_constraint, 10 to the sequence. Is that ok? Other thing: #define CONSTRAINT_NOTNULL 'n' in src/include/catalog/pg_constraint.h is using spaces instead of tabs :-) -- José Arthur Benetasso Villanova
