Re: Proper relational database? - Mailing list pgsql-general

From Geoff Winkless
Subject Re: Proper relational database?
Date
Msg-id CAEzk6fdj77LqhSJtgmbqbx3oyCkq3cDHYwX-9kCHqhrPpm1ZRg@mail.gmail.com
Whole thread Raw
In response to Re: Proper relational database?  (Manuel Gómez <targen@gmail.com>)
Responses Re: Proper relational database?
Re: Proper relational database?
List pgsql-general
On 23 April 2016 at 07:08, Manuel Gómez <targen@gmail.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


pgsql-general by date:

Previous
From:
Date:
Subject: Re: Proper relational database?
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Proper relational database?