Re: correct format for date, time, timestamp for XML functionality

From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-patches(at)postgresql(dot)org, peter_e(at)gmx(dot)net
Subject: Re: correct format for date, time, timestamp for XML functionality
Date: 2007-02-20 14:51:28
Message-ID: BAY20-F10528F9E637F2D4FEE9E4CF9890@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


>"Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com> writes:
> > this patch ensures independency datetime fields on current datestyle
> > setting. Add new internal datestyle USE_XSD_DATESTYLE. It's almoust same
>to
> > USE_ISO_DATESTYLE. Differences are for timestamp:
>
> > ISO: yyyy-mm-dd hh24:mi:ss
> > XSD: yyyy-mm-ddThh24:mi:ss
>
>Why is that a good idea? Even if some standard out there mandates the
>'T', I'd bet lunch that the other format is a whole lot more portable.
>

if you use xsd schema then situation is clear. I have to respect it, because
xsd:datetime is well defined and SQL/XML expect respecting xsd. If I don't
use xsd schema, then I teoreticly can put date in any format. Sample: we use
german format, but everybody with good mind doesn't use it for xml, because
then he cannot use xml validation based on xsd schema.

xsd format use Oracle 10g:
http://forums.oracle.com/forums/thread.jspa?threadID=467278&tstart=0
9x used ISO format, which is (however) invalid.

http://books.xmlschemata.org/relaxng/ch19-77049.html

Currently without this patch PostgreSQL generate invalalid xml documents.
That is all.

My patch doesn't protect any output. Simply use cast to text, or to_char
fce.

nice a day
Pavel Stehule

_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com.
http://www.msn.cz/

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2007-02-20 14:51:50 Re: [HACKERS] HOT WIP Patch - version 2
Previous Message Tom Lane 2007-02-20 14:50:40 Re: [HACKERS] HOT WIP Patch - version 2