pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas G. Lockhart <lockhart@alumni.caltech.edu>
To: eg@tzv.fal.de
Cc: Postgres Interfaces Mailing List <pgsql-interfaces@postgresql.org>
Subject: Re: [INTERFACES] Bug in sortin routine?
Date: Tue, 09 Mar 1999 17:29:42 +0000
Message-ID: <36E55A86.6164C50@alumni.caltech.edu> (raw)
References: <36E53955.6655F50@alumni.caltech.edu>
	<99030916371302.00479@salo.tzv.fal.de>

(back on list)

> >> > [...] It seems that the sorting order on dates is incorrect under
> >> > certain circumstances: [...]  set DateStyle to 'German'; (does 
> >> > not have an effect on the problem) [...]
> >> From the examples you gave it appears that you are still using
> >> American date format (YYYY-MM-DD)
> >An irrelevant detail: the YYYY-MM-DD date format is ISO-8601, and is 
> >not particularly common in America. The US style looks like 
> >MM/DD/YYYY.
> >I think your analysis and recommendations are correct; the sort order 
> >in the example looked good to me too...
> unfortunately, the sort order is indeed *not* correct.
<snip>

I think we have different ideas on what "correct" means. In my case,
"correct" means that the result looks as I would expect, and I
implemented the code. You apparently want something different, or are
pointing out a problem that I'm simply not seeing despite your best
efforts :)

> These are transaction dates which have taken place at the beginning of
> each months.

Are you saying that these dates should be on the first of each month?
That is not what you are entering into the table...

You did not describe the schema or the version of Postgres you are
using. Is there a (minor) time zone rotation you are seeing which could
be ascribed to a know problem in the "date" data type in pre-v6.4.2 +
patches?

> BTW:ida=> show datestyle;
> NOTICE:  DateStyle is ISO with US (NonEuropean) conventions

The US or European conventions affect *input* values when the DateStyle
is ISO but the actual input is in some other convention (e.g. "US" or
"European" traditional Postgres or SQL formats). It does not affect the
output values. Please look at the chapter on data types in the "new"
documentation for more details.

> The problem seems to be that under certain circumstances the datestyle 
> is not used:
> as can be seen the month and day columns are switched. The sorting is 
> ok in the latter case but not in the first.
> It seems to me that we still do have a problem.

Please read the docs on the date/time data types. I believe that the
examples and descriptions there will help. As I've indicated, I think
the result you are seeing is as I would expect it to be for an ISO-8601
format, which is what is implemented.

Regards.

                       - Tom



view thread (4+ messages)

Message-ID: <36E55A86.6164C50@alumni.caltech.edu>
Permalink:  ../36E55A86.6164C50@alumni.caltech.edu/
Also on:    postgresql.org/message-id/36E55A86.6164C50@alumni.caltech.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: lockhart@alumni.caltech.edu, eg@tzv.fal.de
  Subject: Re: [INTERFACES] Bug in sortin routine?
  In-Reply-To: <36E55A86.6164C50@alumni.caltech.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox