From: | Suresh_ <suiyengar(at)yahoo(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Performing antijoin in postgres |
Date: | 2007-08-31 12:37:37 |
Message-ID: | 12425655.post@talk.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thanks for the reply. I can do this at the higher level; but this antijoin
thing is a small part of a bigger project. So I want to do it internally in
one of the joins. Does anyone have experience in storing tupleslpts and
comparing them ??
Gregory Stark wrote:
>
> "Suresh_" <suiyengar(at)yahoo(dot)com> writes:
>
>> I want to add an antijoin operator to PostgreSql.
>
> I think you can already do what you want like this:
>
> SELECT *
> FROM A FULL OUTER JOIN B ON (x=y)
> WHERE x IS NULL
> OR y IS NULL
>
> So for example:
>
> postgres=# select * from a;
> i
> ---
> 1
> 2
> (2 rows)
>
> postgres=# select * from b;
> i
> ---
> 2
> 3
> (2 rows)
>
> postgres=# select * from a full outer join b on (a.i=b.i) where a.i is
> null or b.i is null;
> i | i
> ---+---
> 1 |
> | 3
> (2 rows)
>
> --
> Gregory Stark
> EnterpriseDB http://www.enterprisedb.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
--
View this message in context: http://www.nabble.com/Performing-antijoin-in-postgres-tf4358905.html#a12425655
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 2007-08-31 12:46:28 | Re: Final background writer cleanup for 8.3 |
Previous Message | Jan Wieck | 2007-08-31 12:35:47 | Re: Final background writer cleanup for 8.3 |