pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander M. Pravking <fduch@antar.bryansk.ru>
To: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Validity check in to_date?
Date: Tue, 2 Dec 2003 13:30:59 +0300
Message-ID: <20031202103059.GG87728@dyatel.antar.bryansk.ru> (raw)
In-Reply-To: <200312020927.KAA17321@rodos>
References: <20031127141125.GC87728@dyatel.antar.bryansk.ru>
	<200312020927.KAA17321@rodos>

On Tue, Dec 02, 2003 at 10:27:04AM +0100, Christoph Haller wrote:
> As far as I know these results are correct in terms of the underlying 
> C-library function mktime(). This function is intended to be used when 
> adding/subtracting intervals from a given timestamp. 

Which one? mktime() or to_date()? I'm not sure it's handy to use
to_date() for any calculations, so I'm surprised why doesn't it work
just as date_in() do.


> I don't know of any postgres function doing the check you're looking for. 

Yes, the only thing I could think now is to do something like
s/([0-9]+)\.([0-9]+)\.([0-9]+)/\3-\2-\1/ and then pass it to
CAST(... AS date) using ISO DateStyle.

(I could simply use German DateStyle in case of DD.MM.YYYY, but I deal
with several date formats, e.g. DD/MM/YYYY.)


> But I can't believe this is the first time this topic is brought up. 
> You may search the archives on "date plausibility" are related terms. 

I'm sure too, but it's really hard to find a good keyword sequence when
searching such sort of things :(

Anyway, thank you for attention.

-- 
Fduch M. Pravking



view thread (11+ messages)  latest in thread

Message-ID: <20031202103059.GG87728@dyatel.antar.bryansk.ru>
Permalink:  ../20031202103059.GG87728@dyatel.antar.bryansk.ru/
Also on:    postgresql.org/message-id/20031202103059.GG87728@dyatel.antar.bryansk.ru

 · 

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-sql@postgresql.org
  Cc: fduch@antar.bryansk.ru, ch@rodos.fzk.de
  Subject: Re: Validity check in to_date?
  In-Reply-To: <20031202103059.GG87728@dyatel.antar.bryansk.ru>

* 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