Re: [HACKERS] Small foreign key error message improvement

2009-07-07 Thread Peter Eisentraut
On Monday 06 July 2009 23:00:18 Tom Lane wrote: It seems to me that the right fix here is not so much to tweak the message wording as to put in an error location cursor. In more complicated cases (eg, multiple FOREIGN KEY clauses) the suggested wording change wouldn't help much anyway. It

Re: [HACKERS] Small foreign key error message improvement

2009-07-07 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Monday 06 July 2009 23:00:18 Tom Lane wrote: It seems to me that the right fix here is not so much to tweak the message wording as to put in an error location cursor. In more complicated cases (eg, multiple FOREIGN KEY clauses) the suggested

[HACKERS] Small foreign key error message improvement

2009-07-06 Thread Peter Eisentraut
I recently had a puzzler, which involved this sort of accidental parser error: CREATE TABLE foo (a int, b text, PRIMARY KEY (a, b)); CREATE TABLE bar (x int, y text, FOREIGN KEY (q, r) REFERENCES foo (m, n)); ERROR: column q referenced in foreign key constraint does not exist versus CREATE

Re: [HACKERS] Small foreign key error message improvement

2009-07-06 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: I recently had a puzzler, which involved this sort of accidental parser error: CREATE TABLE foo (a int, b text, PRIMARY KEY (a, b)); CREATE TABLE bar (x int, y text, FOREIGN KEY (q, r) REFERENCES foo (m, n)); ERROR: column q referenced in foreign key