Received: from acheron.rime.com.au (root@albatr.lnk.telstra.net [139.130.54.222]) by hub.org (8.10.1/8.10.1) with ESMTP id e9BDrdr27751 for ; Wed, 11 Oct 2000 09:53:40 -0400 (EDT) Received: from oberon (Oberon.rime.com.au [203.8.195.100]) by acheron.rime.com.au (8.9.3/8.9.3) with SMTP id XAA17479; Wed, 11 Oct 2000 23:53:56 +1000 Message-Id: <3.0.5.32.20001012005503.02140d00@mail.rhyme.com.au> X-Sender: pjw@mail.rhyme.com.au X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Thu, 12 Oct 2000 00:55:03 +1000 To: "Oliver Elphick" , pgsql-sql@postgresql.org From: Philip Warner Subject: Re: Can I use subselect as a function parameter? In-Reply-To: <200010111342.e9BDg5Y26824@linda.lfix.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Archive-Number: 200010/104 X-Sequence-Number: 1766 At 14:42 11/10/00 +0100, Oliver Elphick wrote: > > CONSTRAINT ean CHECK ( > CASE WHEN eancode IS NULL OR brand IS NULL > THEN 't' > ELSE ean_checkdigit( > (SELECT ean_prefix > FROM brandname, product > WHERE brandname.id = product.brand > ), eancode) > END > ) >); > > >Can this be made to work at all (in 7.0.2)? > The short answer is that subselect in CHECK is not currently supported, and is not planned for 7.1. There was a thread about subselect in CHECK not so long ago (see 'checking number of entries' on or around the 29/9). There was apparently also an earlier discussion in which the meaning were not deemed to be clear. I think the most recent discussion at least resolved the meaning, but not the locking issues. ---------------------------------------------------------------- Philip Warner | __---_____ Albatross Consulting Pty. Ltd. |----/ - \ (A.B.N. 75 008 659 498) | /(@) ______---_ Tel: (+61) 0500 83 82 81 | _________ \ Fax: (+61) 0500 83 82 82 | ___________ | Http://www.rhyme.com.au | / \| | --________-- PGP key available upon request, | / and from pgp5.ai.mit.edu:11371 |/