Composite type

From: antono124 <g(dot)antonopoulos000(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Composite type
Date: 2014-01-26 17:02:10
Message-ID: 1390755730306-5788860.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello guys!

I have found a example in Oracle and I am trying to do it in Postgre.

Lets say that we have 2 tables.
Create Table "table1" Of "type1"
Create Table "table2" Of "type2"

I want to refer the first table in the second. I want to reference the whole
table not only one field, so something like that:

CREATE TYPE type2 AS OBJECT (
var1 NUMBER,
var2 REF type1
)

CREATE TABLE table2 OF type2 (
PRIMARY KEY (Pk),
FOREIGN KEY (fk) REFERENCES table1)

Can i do something like this in Postgre?

Thank you in advance!
George Ant

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Composite-type-tp5788860.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2014-01-26 17:27:33 fastest dump/restore
Previous Message Alban Hertroys 2014-01-26 10:06:40 Re: pg_dump: dumpBlobs(): could not open large object: ERROR: large object 27729547 does not exist