Re: [GENERAL] date format

2007-03-05 Thread Raymond O'Donnell
On 05/03/2007 12:16, Joshua D. Drake wrote: I didn't really explain my point here. You an use datestyle from a session, or you can reload the server. You do not need to *restart*. Yes, that's what I was getting at as well - I was in a hurry at the time and "restart" was the wrong word to use.

Re: [GENERAL] date format

2007-03-05 Thread Joshua D. Drake
Peter Eisentraut wrote: Am Sonntag, 4. März 2007 17:16 schrieb Raymond O'Donnell: Probably a silly question, but did you remember to restart the server after changing the datestyle setting? You don't need to do that. I didn't really explain my point here. You an use datestyle from a

Re: [GENERAL] date format

2007-03-05 Thread Peter Eisentraut
Am Sonntag, 4. März 2007 17:16 schrieb Raymond O'Donnell: > Probably a silly question, but did you remember to restart the server > after changing the datestyle setting? You don't need to do that. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of br

Re: [GENERAL] date format

2007-03-04 Thread Tino Wildenhain
Garry Saddington schrieb: I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is still rendered in the format (y,m,d) . How can I change this behaviour? regards garry See my answer on the Zope list. The style however influences the way dates are parsed by default, so you nee

Re: [GENERAL] date format

2007-03-04 Thread Raymond O'Donnell
On 04/03/2007 19:26, Raymond O'Donnell wrote: Ahh! Then you need to use to_char(). The datestyle setting in http://www.postgresql.org/docs/8.2/static/functions-formatting.html --- Raymond O'Donnell, Director of Music, Galway Cathedra

Re: [GENERAL] date format

2007-03-04 Thread Raymond O'Donnell
On 04/03/2007 18:56, Garry Saddington wrote: # select now(); now --- 2007-03-04 18:07:54.626267+01 (1 row) Which is precisely what I expect. Which is precisely what I get, but I want 04-03-2007. Ahh! Then you need to use to_char(). The datestyle set

Re: [GENERAL] date format

2007-03-04 Thread Garry Saddington
On Sunday 04 March 2007 17:09, Martijn van Oosterhout wrote: > On Sun, Mar 04, 2007 at 05:05:44PM +, Garry Saddington wrote: > > On Sunday 04 March 2007 16:16, Raymond O'Donnell wrote: > > > On 04/03/2007 16:16, Garry Saddington wrote: > > > > I tried pgAdmin3 on windows to run 'select now()'

Re: [GENERAL] date format

2007-03-04 Thread Joshua D. Drake
Garry Saddington wrote: I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is still rendered in the format (y,m,d) . How can I change this behaviour? Did you restart PostgreSQL after making the change? You can also set it on the fly per session. Joshua D. Drake rega

Re: [GENERAL] date format

2007-03-04 Thread Martijn van Oosterhout
On Sun, Mar 04, 2007 at 05:05:44PM +, Garry Saddington wrote: > On Sunday 04 March 2007 16:16, Raymond O'Donnell wrote: > > On 04/03/2007 16:16, Garry Saddington wrote: > > > I tried pgAdmin3 on windows to run 'select now()' and it still does not > > > return the correct datestyle. > > > > Pro

Re: [GENERAL] date format

2007-03-04 Thread Garry Saddington
On Sunday 04 March 2007 16:16, Raymond O'Donnell wrote: > On 04/03/2007 16:16, Garry Saddington wrote: > > I tried pgAdmin3 on windows to run 'select now()' and it still does not > > return the correct datestyle. > > Probably a silly question, but did you remember to restart the server > after cha

Re: [GENERAL] date format

2007-03-04 Thread Raymond O'Donnell
On 04/03/2007 16:16, Garry Saddington wrote: I tried pgAdmin3 on windows to run 'select now()' and it still does not return the correct datestyle. Probably a silly question, but did you remember to restart the server after changing the datestyle setting? Ray. -

Re: [GENERAL] date format

2007-03-04 Thread Garry Saddington
On Sunday 04 March 2007 15:28, Raymond O'Donnell wrote: > On 04/03/2007 12:58, Jorge Godoy wrote: > > Garry Saddington <[EMAIL PROTECTED]> writes: > >> I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is > >> still rendered in the format (y,m,d) . How can I change this behaviou

Re: [GENERAL] date format

2007-03-04 Thread Raymond O'Donnell
On 04/03/2007 12:58, Jorge Godoy wrote: Garry Saddington <[EMAIL PROTECTED]> writes: I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is still rendered in the format (y,m,d) . How can I change this behaviour? ISO means y-m-d... The default postgresql.conf that is ins

Re: [GENERAL] date format

2007-03-04 Thread Jorge Godoy
Garry Saddington <[EMAIL PROTECTED]> writes: > I have 'datestyle ISO,DMY' set in postgresql.conf but the date output is > still > rendered in the format (y,m,d) . How can I change this behaviour? ISO means y-m-d... -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of

Re: [GENERAL] date format

2005-12-08 Thread David Rysdam
David Rysdam wrote: David Rysdam wrote: I could swear (but I don't think I can prove at this point) that 8.0 beta3 returned timestamps with milliseconds, like this: -MM-DD HH24:MI:SS.MS But 8.1 isn't doing that. I see functions to format the date, but that would require me to change a

Re: [GENERAL] date format

2005-12-08 Thread David Rysdam
David Rysdam wrote: I could swear (but I don't think I can prove at this point) that 8.0 beta3 returned timestamps with milliseconds, like this: -MM-DD HH24:MI:SS.MS But 8.1 isn't doing that. I see functions to format the date, but that would require me to change all my existing SQL to

Re: [GENERAL] Date format for bulk copy

2004-10-14 Thread Michael Fuhr
On Wed, Oct 13, 2004 at 03:37:14PM -0400, David Rysdam wrote: > Michael Fuhr wrote: > > > >I'd probably choose to extend PostgreSQL rather than hack what > >already exists, though. > > By "extend PostgreSQL" do you mean create a custom input_function for > timestamp? Are there docs that give hint

Re: [GENERAL] Date format for bulk copy

2004-10-14 Thread Michael Fuhr
On Wed, Oct 13, 2004 at 08:36:50PM +0200, Pierre-Fr?d?ric Caillaud wrote: > > You can have your script make a query in the database to fetch the > data types of the fields and then know which ones are to be transformed > and how. The script would take as arguments a dump file and a

Re: [GENERAL] Date format for bulk copy

2004-10-13 Thread David Rysdam
Michael Fuhr wrote: On Wed, Oct 13, 2004 at 01:32:01PM -0400, David Rysdam wrote: Michael Fuhr wrote: You could filter the data through a script that reformats certain fields, then feed the reformatted data to PostgreSQL. This is usually a trivial task for Perl, awk, sed, or the like.

Re: [GENERAL] Date format for bulk copy

2004-10-13 Thread Pierre-Frédéric Caillaud
Right, I *can* do this. But then I have to build knowledge into that script so it can find each of these date fields (there's like 20 of them across 10 different files) and then update that knowledge each time it changes. In your case that's a reasonable argument against filtering the data with a

Re: [GENERAL] Date format for bulk copy

2004-10-13 Thread Michael Fuhr
On Wed, Oct 13, 2004 at 01:32:01PM -0400, David Rysdam wrote: > Michael Fuhr wrote: > >You could filter the data through a script that reformats certain > >fields, then feed the reformatted data to PostgreSQL. This is > >usually a trivial task for Perl, awk, sed, or the like. > > > Right, I *can*

Re: [GENERAL] Date format for bulk copy

2004-10-13 Thread David Rysdam
Greg Stark wrote: David Rysdam <[EMAIL PROTECTED]> writes: In my brute force port, I just bulk copied the date fields into temporary tables and then did a to_timestamp(field, 'Mon DD HH:MI:SS:MSAM'). Again, I created a temporary table and did a decode(field, 'hex') to the real tabl

Re: [GENERAL] Date format for bulk copy

2004-10-13 Thread David Rysdam
Michael Fuhr wrote: On Wed, Oct 13, 2004 at 10:06:58AM -0400, David Rysdam wrote: Sybase bulk copies the date fields out in this format: Mar 4 1973 10:28:00:000AM Postgresql's COPY (or psql \copy) doesn't like that format. You could filter the data through a script that reformats certain f

Re: [GENERAL] Date format for bulk copy

2004-10-13 Thread Michael Fuhr
On Wed, Oct 13, 2004 at 10:06:58AM -0400, David Rysdam wrote: > Sybase bulk copies the date fields out in this format: > > Mar 4 1973 10:28:00:000AM > > Postgresql's COPY (or psql \copy) doesn't like that format. You could filter the data through a script that reformats certain fields, then fe

Re: [GENERAL] Date format for bulk copy

2004-10-13 Thread Greg Stark
David Rysdam <[EMAIL PROTECTED]> writes: > In my brute force port, I just bulk copied the date > fields into temporary tables and then did a to_timestamp(field, 'Mon DD > HH:MI:SS:MSAM'). > Again, I created a temporary table and did a decode(field, 'hex') to the > real table. This is the

Re: [GENERAL] date format problem

2000-05-03 Thread Anand Raman
helps Anand Raman - Original Message - From: Bill Barnes <[EMAIL PROTECTED]> To: Anand Raman <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 03, 2000 1:51 PM Subject: RE: [GENERAL] date format problem > Hello Anand: > > Thanks for the input. >

RE: [GENERAL] date format problem

2000-05-03 Thread Lincoln Yeoh
I dunno, I'm using 6.5.3 and have no probs pgdumping, pguploading and using null dates - moved my app to another server etc, and the null dates are still there. The null dates are dumped as \N which presumably means NULL (but for some reason typing \N (two characters - backslash then N) works for

RE: [GENERAL] date format problem

2000-05-03 Thread Bill Barnes
Hello Anand: Thanks for the input. The problem turned out to be date fields with null values. Disappointing! A lot of my Sybase procedures tested for null dates. So my workaround was to edit the null dates to a pseudo date. This is least got my database poplulated. Will try the cast for que

Re: [GENERAL] date format problem

2000-05-02 Thread Anand Raman
HI bill Try to cast the field to the datetime type 'ur_string_goes_here'::datetime Hope this will help Anand Raman - Original Message - From: Bill Barnes <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 28, 2000 6:09 PM Subject: [GENERAL] date format problem > Hello Li