Foreign key constraint on sub-column of composite-type column

From: David Lee <davidomundo(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Foreign key constraint on sub-column of composite-type column
Date: 2012-10-20 05:57:52
Message-ID: 840CE09C-048A-4D91-9A11-4BE75D31C581@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I was trying to create foreign key constraints on a sub-column of a composite-type column, but couldn't find a way to do it. After asking around on IRC, it seems like this isn't supported in PostgreSQL.

I wanted to do something like:

create type profile as (account_id integer);

create table users (profile profile);

alter table users add constraint account_fk foreign key ((profile).account_id) references accounts;

Would this be a viable feature request?

--David

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit kapila 2012-10-20 06:00:52 Re: [WIP PATCH] for Performance Improvement in Buffer Management
Previous Message Tom Lane 2012-10-20 03:37:07 Re: assertion failure w/extended query protocol