Skip site navigation (1) Skip section navigation (2)

Foreign Keys referencing a View

From: Alessio Bragadini <alessio(at)albourne(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
Subject: Foreign Keys referencing a View
Date: 2000-04-06 12:20:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
I noticed a behaviour in PostgreSql 7 (beta 3, Alpha, Digital Unix 4.0f,
cc) that probably needs to be addressed.

If I create a table referencing a view

create table mytable (id serial, name text);
create view myview as select * from mytable where name like 'A%';
create table othertable (id serial, refer integer references myview

the engine doesn't complain, but

insert into mytable (name) values ('Alpha');
insert into othertable (refer) values (1);
ERROR:  system column oid not available - myview is a view

which looks sensible. But probably the errors should have been raised at 
'create table othertable'.

What do you think?

Alessio F. Bragadini		alessio(at)albourne(dot)com
APL Financial Services
Nicosia, Cyprus		 	phone: +357-2-750652

"It is more complicated than you think"
		-- The Eighth Networking Truth from RFC 1925

pgsql-hackers by date

Next:From: Thomas LockhartDate: 2000-04-06 13:33:55
Subject: Re: 7.1 items
Previous:From: Karel ZakDate: 2000-04-06 11:02:45
Subject: pg_dumplo, thanks :) (fwd)

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group