pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: evl@my-mail.com.ua
Cc: pgsql-sql@postgresql.org
Subject: Re: How to check: is some key referenced from sometable
Date: Sat, 9 Aug 2003 10:08:09 -0500
Message-ID: <20030809150809.GA22927@wolff.to> (raw)
In-Reply-To: <3159.195.5.48.107.1059985076.squirrel@my-mail.com.ua>
References: <3159.195.5.48.107.1059985076.squirrel@my-mail.com.ua>

On Mon, Aug 04, 2003 at 11:17:56 +0300,
  evl@my-mail.com.ua wrote:
> Please help.
> 
> Need a boolean function which returns true if given key in table is
> referensed from another table(s).

Use "exists" with a subselect. Something like:
select exists(select 1 from table where table.key = 'value');



view thread (5+ messages)  latest in thread

Message-ID: <20030809150809.GA22927@wolff.to>
Permalink:  ../20030809150809.GA22927@wolff.to/
Also on:    postgresql.org/message-id/20030809150809.GA22927@wolff.to

 · 

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: bruno@wolff.to, evl@my-mail.com.ua
  Subject: Re: How to check: is some key referenced from sometable
  In-Reply-To: <20030809150809.GA22927@wolff.to>

* 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