foreign key on views

Started by Josh Harrisonover 18 years ago2 messagesgeneral
Jump to latest
#1Josh Harrison
joshques@gmail.com

Hi,
Where in the source code can I see the error message that says foreign key
to a view is not allowed
The exact error message as it appears when I try foreign key reference on a
view is

referenced relation "xyz_view" is not a table

I just wanted to know where is this error message thrown in the source
code.?
Any help will be appreciated.
Thanks
josh

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Josh Harrison (#1)
Re: foreign key on views

"Josh Harrison" <joshques@gmail.com> writes:

I just wanted to know where is this error message thrown in the source
code.?

"\set VERBOSITY verbose" would help...

regression=# create view v as select * from int4_tbl;
CREATE VIEW
regression=# \set VERBOSITY verbose
regression=# create table t (f1 int references v);
ERROR: 42809: referenced relation "v" is not a table
LOCATION: ATAddForeignKeyConstraint, tablecmds.c:3949

regards, tom lane