Re: Range Types - typo + NULL string constructor

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Range Types - typo + NULL string constructor
Дата
Msg-id 1316589819.7281.198.camel@jdavis
обсуждение исходный текст
Ответ на Re: Range Types - typo + NULL string constructor  (Florian Pflug <fgp@phlo.org>)
Ответы Re: Range Types - typo + NULL string constructor
Список pgsql-hackers
On Mon, 2011-09-19 at 18:32 +0200, Florian Pflug wrote:
> No, but more similar the format are the easier it gets to at least factor
> the hairy parts of such a parser into a common subroutine. Assume that we
> don't support NULL as an alias for INF. What would then be the result of
> 
>   '[A,NULL)'::textrange?

I think that the range input should *parse* NULL in a similar way, but
reject it. So, to make it the range between two definite strings, you'd
do:
 '[A,"NULL")'::textrange

which would be equal to textrange('A','NULL','[)'). Without the quotes,
it would detect the NULL, and give an error. Open to suggestion here,
though.

> Presumably, it'd be the same as textrange('A','NULL','[)'). Which think
> is a bit surprising, since '[A,NULL]'::text[] produces ARRAY['A',NULL],
> *NOT* ARRAY['A','NULL'].
> 
> BTW, we currently represent infinity for floating point values as
> 'Infinity', not 'INF'. Shouldn't we do the same for ranges, i.e. make
> 
>   int4range(0,NULL,'[)')::text
> 
> return 
> 
>   '[0,Infinity)'?

I'm open to that, if you think it's an improvement I'll do it (but we
should probably pick one identifiable string and stick with it). What
I'd like to avoid is adding to the NULL/infinity confusion.

Regards,Jeff Davis



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: WIP: Join push-down for foreign tables
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Range Types - typo + NULL string constructor