Composite type - Mailing list pgsql-general

From antono124
Subject Composite type
Date
Msg-id 1390755730306-5788860.post@n5.nabble.com
Whole thread Raw
Responses Re: Composite type  (Michael Paquier <michael.paquier@gmail.com>)
Re: Composite type  (John R Pierce <pierce@hogranch.com>)
Re: Composite type  (Kevin Grittner <kgrittn@ymail.com>)
Re: Composite type  (George Ant <g.antonopoulos000@gmail.com>)
List 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.


pgsql-general by date:

Previous
From: Dmitry Koterov
Date:
Subject: Re: Fully-automatic streaming replication failover when master dies?
Next
From: Emmanuel Medernach
Date:
Subject: Re: postgres-fdw questions