pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Philip Warner <pjw@rhyme.com.au>
To: Oliver Elphick <olly@lfix.co.uk>
To: pgsql-sql@postgresql.org
Subject: Re: Can I use subselect as a function parameter?
Date: Thu, 12 Oct 2000 00:55:03 +1000
Message-ID: <3.0.5.32.20001012005503.02140d00@mail.rhyme.com.au> (raw)
In-Reply-To: <200010111342.e9BDg5Y26824@linda.lfix.co.uk>

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   |/



view thread (3+ messages)

Message-ID: <3.0.5.32.20001012005503.02140d00@mail.rhyme.com.au>
Permalink:  ../3.0.5.32.20001012005503.02140d00@mail.rhyme.com.au/
Also on:    postgresql.org/message-id/3.0.5.32.20001012005503.02140d00@mail.rhyme.com.au

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: pjw@rhyme.com.au, olly@lfix.co.uk
  Subject: Re: Can I use subselect as a function parameter?
  In-Reply-To: <3.0.5.32.20001012005503.02140d00@mail.rhyme.com.au>
  References: <200010111342.e9BDg5Y26824@linda.lfix.co.uk> <3.0.5.32.20001012005503.02140d00@mail.rhyme.com.au>

* 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