[SQL] SQL DDL: FOREIGN KEY construct and field mapping: unexpected behavior

2004-06-06 Thread Neil Zanella
Hello, Consider the following code run under PostgreSQL 7.3.4: CREATE TABLE X ( A INT, B INT, PRIMARY KEY (A, B) ); CREATE TABLE Y ( A INT, B INT, C INT, PRIMARY KEY (C), FOREIGN KEY (B, A) REFERENCES X ); INSERT INTO X (A, B) VALUES (1, 2); INSERT INTO Y (A, B, C) VALUES (1, 2,

[SQL] defining and using constants in postgreSQL

2003-10-26 Thread Neil Zanella
Hello, I am looking for a way that I can define a constant in PostgreSQL (so that I end up with a constant similar to one that I could have in Oracle). I have searched the archives and it seems that the solutions that were suggested in include creating a table of constants or alternatively creatin