Re: table as field type??
От | Tod McQuillin |
---|---|
Тема | Re: table as field type?? |
Дата | |
Msg-id | Pine.LNX.4.21.0010040041550.1978-100000@glass обсуждение исходный текст |
Ответ на | table as field type?? (David Diller <ddiller@bbn.com>) |
Ответы |
Re: table as field type??
|
Список | pgsql-sql |
On Tue, 3 Oct 2000, David Diller wrote: > I noticed that it's possible to have a table as a field type. > For example: > create table foo (val1 integer); > create table bar (val2 foo); > > val2 in table bar ends up as an int4, designed for storing an oid from > table foo. > Is there a way to perform a query on bar that will return values from table > foo (i.e., val1)? I didn't know you could use a table name as a type either. I thought something like this might join the tables: select val1 from foo, bar where bar.val2::oid = foo.oid ; But I get "ERROR: Cannot cast type 'foo' to 'oid'" You can't seem to cast an oid into a foo either. -- Tod McQuillin
В списке pgsql-sql по дате отправления: