Is there any advantages whatsoever, other than style to writing this,
CREATE TABLE foo ( a int PRIMARY KEY, b int );
CREATE TABLE bar ( a int REFERENCES foo, c int );
BEGIN; CREATE TABLE bar ( a int, c int ); ALTER TABLE bar ADD FOREIGN KEY (a) REFERENCES foo; COMMIT;
I'm trying to build a DDL generator, so I'm wondering if pays to keep constraints on the column (where I was generating them before), or to move them all outside to the table? I know these results produce the same table, I'm just wondering if there is any advantage under the hood -- less wal? etc?