date bug

From: "Jeff Patterson" <jpat(at)mywayhealth(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: date bug
Date: 2001-05-15 01:33:32
Message-ID: 1D9DC8FD001A924DA482B2B85E2EC6AD01B52D@redmond.mwhnorth.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Strange date behavior as shown below.

create table "holidays" ("date" date NOT NULL,"name" varchar(25));
insert into holidays values ('01-01-2001'::date,'New Years');
insert into holidays values ('01-15-2001'::date,'Kings Birthday');
insert into holidays values ('02-19-2001'::date,'Presidents Day');

create function is_holiday (date) returns bool as
'select
case
when $1=date then 1::bool
else 0::bool
end
from holidays' language 'sql'

test=# select date,is_holiday(date) from holidays;

date | is_holiday
-----------------+------------
2001-01-01 | t
2001-01-15 | f
2001-02-19 | f
(3 rows)

-------------------------------------------
Jeffery S. Patterson
Meta-Lynx

e-mail: jpat(at)meta-lynx(dot)com
Phone : 707-431-9320
Fax : 707-433-2918

Meta-Lynx
132 Mill St. Suite 210
Healdsburg, CA 95448

=======================================================================
This message contains information that may be confidential and
privileged. Unless you are the addressee (or authorized to receive for
the addressee), you may not use, copy or disclose to anyone the message
or any information contained in the message. If you have received the
message in error, please advise the sender by reply e-mail
jpat(at)meta-lynx(dot)com, and delete the message. Thank you very much.
=======================================================================

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-05-15 02:43:12 Re: REQ: build src/backend/postgres w/o -lncurses or -lreadline
Previous Message Tom Lane 2001-05-15 00:49:22 Re: Postgres bug (working with iserverd)