Re: Proper relational database?

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Manuel Gómez <targen(at)gmail(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, david(at)andl(dot)org, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Proper relational database?
Date: 2016-04-23 15:09:43
Message-ID: CAEzk6fdj77LqhSJtgmbqbx3oyCkq3cDHYwX-9kCHqhrPpm1ZRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 23 April 2016 at 07:08, Manuel Gómez <targen(at)gmail(dot)com> wrote:
> but its semantics can be rather wonky. Witness:
>
> postgres=# select 1;
> ?column?
> ----------
> 1
> (1 row)
>
> postgres=# select 1 union select 1;
> ?column?
> ----------
> 1
> (1 row)

Exactly what you would expect. Use UNION ALL to get two rows.

> postgres=# select;
> --
> (1 row)
>
> postgres=# select union select;
> --
> (2 rows)

SELECT with no values is selecting a NULL, and two NULLs do not
equate, so you would expect two rows.

> postgres=# select 1 intersect select 1;
> ?column?
> ----------
> 1
> (1 row)
>
> postgres=# select intersect select;
> --
> (2 rows)

See above.

Geoff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2016-04-23 15:26:00 Re: Proper relational database?
Previous Message david 2016-04-23 14:30:44 Re: Proper relational database?