Lists: pgsql-hackers
From: "Erik Rijkers" <er(at)xs4all(dot)nl>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject:
Date: 2011-10-29 19:12:22
Message-ID: 031fdccc1e830a646622111b5362e7c0.squirrel@webmail.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Would it be possible to remove of the double quotes in the daterange display of BC dates?

select '[0001-10-29 BC,2011-10-29)'::daterange;
daterange
------------------------------
["0001-10-29 BC",2011-10-29)
(1 row)

after all, it's also:

select '0001-10-29 BC'::date;
date
---------------
0001-10-29 BC
(1 row)

without double quotes. It's not important, perhaps; it just looks ugly to me.

Do they serve a purpose?

Erik Rijkers


From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re:
Date: 2011-11-01 05:47:50
Message-ID: 1320126470.23464.10.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, 2011-10-29 at 21:12 +0200, Erik Rijkers wrote:
> Would it be possible to remove of the double quotes in the daterange display of BC dates?
>
> select '[0001-10-29 BC,2011-10-29)'::daterange;
> daterange
> ------------------------------
> ["0001-10-29 BC",2011-10-29)
> (1 row)

It accepts values without quotes, but on output it quotes them similar
to a record type.

Try:

create table foo(d date);
select '(0001-10-29 BC)'::foo;

The spaces are the only reason it's being quoted there. I think it's
best to be fairly consistent, and it was suggested that I model the
input parsing after the record parsing.

Regards,
Jeff Davis