Why select 1 where current_date = 'infinity'; doesn't work?

Lists: pgsql-general
From: "Francisco Figueiredo Jr(dot)" <francisco(at)npgsql(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Why select 1 where current_date = 'infinity'; doesn't work?
Date: 2008-10-14 14:58:15
Message-ID: 438d02260810140758n5bef98cft826ef8ffa9f39b1b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

It gives me the following error:

ERROR: invalid input syntax for type date: "infinity"

I thought I could use it anywhere in my sql.

I have to add a cast to timestamp in order for this to work. I thought
I wouldn't need to use a case.

Am I missing something?

Thanks in advance.

--
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://fxjr.blogspot.com
http://www.npgsql.org


From: "Francisco Figueiredo Jr(dot)" <francisco(at)npgsql(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Why select 1 where current_date = 'infinity'; doesn't work?
Date: 2008-10-14 15:04:15
Message-ID: 438d02260810140804h4690b31cyb14ccfa334651919@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Tue, Oct 14, 2008 at 12:58 PM, Francisco Figueiredo Jr.
<francisco(at)npgsql(dot)org> wrote:
> It gives me the following error:
>
> ERROR: invalid input syntax for type date: "infinity"
>
> I thought I could use it anywhere in my sql.
>
> I have to add a cast to timestamp in order for this to work. I thought
> I wouldn't need to use a case.
>
> Am I missing something?
>

Ok, I think I'm missing something...

Just after sending this message I noticed the current_timestamp
function which works like a charm.

Sorry for the noise.

--
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://fxjr.blogspot.com
http://www.npgsql.org


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: francisco(at)npgsql(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why select 1 where current_date = 'infinity'; doesn't work?
Date: 2008-10-14 15:18:04
Message-ID: 29183.1223997484@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

"Francisco Figueiredo Jr." <francisco(at)npgsql(dot)org> writes:
>> ERROR: invalid input syntax for type date: "infinity"
>> I thought I could use it anywhere in my sql.

No, only timestamps support infinity.

We do have a TODO item to allow type date to do that too. It's been asked
for often enough, not sure why it hasn't happened. Seems easy enough,
maybe I'll go do it.

regards, tom lane


From: "Francisco Figueiredo Jr(dot)" <francisco(at)npgsql(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why select 1 where current_date = 'infinity'; doesn't work?
Date: 2008-10-14 15:30:39
Message-ID: 438d02260810140830w71aaa452s3fb8e798568875dd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Tue, Oct 14, 2008 at 1:18 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Francisco Figueiredo Jr." <francisco(at)npgsql(dot)org> writes:
>>> ERROR: invalid input syntax for type date: "infinity"
>>> I thought I could use it anywhere in my sql.
>
> No, only timestamps support infinity.
>
> We do have a TODO item to allow type date to do that too. It's been asked
> for often enough, not sure why it hasn't happened. Seems easy enough,
> maybe I'll go do it.
>

Thank you very much, Tom, for your feedback on this!!

I will update our forum discussion with this information.

I know this may sound a little bit uncommon, but to me it's an honor
to know you are paying attention to my message! :)

Thanks again.

--
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://fxjr.blogspot.com
http://www.npgsql.org


From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: francisco(at)npgsql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: Why select 1 where current_date = 'infinity'; doesn't work?
Date: 2008-10-14 17:26:25
Message-ID: 20081014172625.GF4452@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> We do have a TODO item to allow type date to do that too. It's been asked
> for often enough, not sure why it hasn't happened. Seems easy enough,
> maybe I'll go do it.

It's certainly be useful for us..

Thanks,

Stephen