Return-Path: postman 
Delivery-Date: Mon, 23 Aug 93 23:11:45 PDT
Return-Path: postman
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA06145; Mon, 23 Aug 93 23:06:22 -0700
Resent-From: postman (POSTGRES mailing list)
Resent-Message-Id: <9308240606.AA06145@postgres.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: jaws@pangaea.dme.nt.gov.au
Received: from DARWIN.NTU.EDU.AU by postgres.Berkeley.EDU (5.61/1.29)
	id AA06137; Mon, 23 Aug 93 23:06:15 -0700
Received: from dme.nt.gov.au ([155.205.2.1]) by DARWIN.NTU.EDU.AU with SMTP; 
          Tue, 24 Aug 1993 15:42:06 GMT
Received: from pangaea.dme by dme.nt.gov.au (4.1/SMI-4.1)
	id AA20789; Tue, 24 Aug 93 15:40:25 CST
Received: from jaws.dme by pangaea.dme (4.1/SMI-4.1)
	id AA21461; Tue, 24 Aug 93 15:41:40 CST
Date: Tue, 24 Aug 93 15:41:40 CST
From: jaws@pangaea.dme.nt.gov.au (James Woods 61-89-895257)
Message-Id: <9308240611.AA21461@pangaea.dme>
To: postgres@postgres.berkeley.edu
Subject: unique elements
Resent-To: postgres-dist
Resent-Date: Mon, 23 Aug 93 23:06:21 PDT

I wish to append attributes from one class into another class on the
condition that one The value of one of the fields doesn't already exist
in the target table.  ie I guess I am trying to enforce a uniqueness
constraint.  The operator != doesn't appear to meet this requirement.
I guess what i want is something along the lines of an operator that
asks if a particular value already exists in a field of a table, for
example lets call this operator !El for now, which returns true if the
value doesn't already exist.  The way I am wanting to use it is as in:

append target(source.a, ........)
	where source.a !El target.a

Another alternative I have for this is to use it in a rule such as:

define rule up_to_date
	in on append to source
		where new.a !El target.a do
		append target(new.a, ........)

The operator !!= appears to serve this role for int4's (though the
manual says not to use it) and I have seen mention of a notin operator,
but can't work out how to use it.  Specifically the field I will be
doing this with will either be a text or an user defined type depending
on which technique I can use.  Is there a way of doing this??

james Woods
jaws@pangaea.dme.nt.gov.au

PS. have I explained my problem clearly or is a followup message required??
