Re: error caused by FOREIGN KEY on composite type - Mailing list pgsql-general

From Tom Lane
Subject Re: error caused by FOREIGN KEY on composite type
Date
Msg-id 10870.1257395039@sss.pgh.pa.us
Whole thread Raw
In response to error caused by FOREIGN KEY on composite type  (silly8888 <silly8888@gmail.com>)
Responses Re: error caused by FOREIGN KEY on composite type  (silly8888 <silly8888@gmail.com>)
List pgsql-general
silly8888 <silly8888@gmail.com> writes:
> create type mytype as (x integer, y integer);

> create table foo(
>     a mytype primary key,
>     b integer
> );

> create table bar(
>     a mytype references foo
> );

While that probably ought to work, is there a really good reason that
you're not doing this with a conventional two-column primary key and
foreign key?  The composite type is going to be exceedingly inefficient,
not to mention not portable to other DBMSes.

            regards, tom lane

pgsql-general by date:

Previous
From: Greg Smith
Date:
Subject: Re: warm standby resume and take online problems
Next
From: Boszormenyi Zoltan
Date:
Subject: Re: How can I pass an array to SPI_execute_with_args()?