From: Richard Huxton <dev@archonet.com>
To: ilejn@yandex.ru
Cc: pgsql-general@postgresql.org
Subject: Re: Old question - failed to find conversion function from
Date: Tue, 19 Jul 2005 15:18:28 +0100
Message-ID: <42DD0BB4.6050108@archonet.com> (raw)
In-Reply-To: <42DCEFEE.000005.12199@mfront8.yandex.ru>
References: <42DCC1E9.2060300@aeccom.com>
<42DCCCCE.000006.04382@mfront8.yandex.ru>
<42DCDE07.4020906@archonet.com>
<42DCEFEE.000005.12199@mfront8.yandex.ru>
Ilja Golshtein wrote:
>>Well, it would obviously be better if PG could figure out it was safe,
>>but I'm not sure there's a general case where it is. You can see it's OK
>>because you know there's only one row in your SELECT result-set.
>
>
> I think, it's OK because NULL can be compared with anything
> with predictable result and no additional information about
> types is necessary.
> Is it correct vision?
Yes*, but you've not got a single NULL in your examples, you've got a
set of rows containing one unnamed column with an unspecified type. That
set happens to have only one row and that contains a NULL.
> I agree it's hard to proceed your query with UNION
> and some sort of error is reasonable here.
But from outside the brackets, they look the same.
What would happen ideally, is that PG would notice we have a single row
and column here and collapse this down to a single scalar value.
However, I'm not sure under what circumstances it can do so (or does),
or whether it is cost-effective.
[* Actually, I think NULLs are typed in SQL, which means you should be
able to get type violations. ]
--
Richard Huxton
Archonet Ltd
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-admin@postgresql.org
Cc: dev@archonet.com, ilejn@yandex.ru, pgsql-general@postgresql.org
Subject: Re: Old question - failed to find conversion function from
In-Reply-To: <42DD0BB4.6050108@archonet.com>
References: <42DCC1E9.2060300@aeccom.com> <42DCCCCE.000006.04382@mfront8.yandex.ru> <42DCDE07.4020906@archonet.com> <42DCEFEE.000005.12199@mfront8.yandex.ru> <42DD0BB4.6050108@archonet.com>
* 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