pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Katona Gabor <katonag@dragon.klte.hu>
Cc: pgsql-sql@postgresql.org
Subject: Re: How to union tables and have a field with UNIQUE constraint?
Date: Thu, 03 Jan 2002 15:51:37 -0500
Message-ID: <15666.1010091097@sss.pgh.pa.us> (raw)
In-Reply-To: <20020103095733.C12608-100000@megazone23.bigpanda.com>
References: <20020103095733.C12608-100000@megazone23.bigpanda.com>

Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> I assume you want to reference id, so you'd need to do something like:

> CREATE UNIQUE INDEX t_id_key ON t(id);

Do we allow that (defining an index on a view)?  [ tries it ]
Apparently so :-(

I would argue that this should be disallowed, since it does not do
anything useful and can only mislead people into thinking that it
has some effect.

> This is a hacky sort of way to do it (we allow you to make the internal
> form that a unique constraint has via create index even on views which
> I don't believe would ever be used :( ) and may not continue working
> forever.

Since triggers on a view won't do anything either, I don't see how one
could expect REFERENCES to a view to work.  The system ought to reject
all this stuff as unimplemented.

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <15666.1010091097@sss.pgh.pa.us>
Permalink:  ../15666.1010091097@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15666.1010091097@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sszabo@megazone23.bigpanda.com, katonag@dragon.klte.hu
  Subject: Re: How to union tables and have a field with UNIQUE constraint?
  In-Reply-To: <15666.1010091097@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox