Re: [GENERAL] Script errors on run

2008-06-04 Thread Ralph Smith
I've tried SO MANY variations of w/ and w/o the apostrophes, but apparently not just the right one. As you knew and I doubted, it NOW WORKS! Whew! You can bet that I'm keeping this snippet of code handy. Thank you very much, Ralph == On Jun 4, 2008, at 4:34 PM,

Re: [GENERAL] Script errors on run

2008-06-04 Thread Stephan Szabo
On Wed, 4 Jun 2008, Ralph Smith wrote: >-- == >good_date := to_date(year||'-'||month||'-'||day , '-MM-DD') ; > >RAISE INFO 'good_date = %', good_date ; > >UsecsD := EXTRACT(EPOCH FROM DATE 'good_date') ; You want something like: UsecsD

Re: [GENERAL] Script errors on run

2008-06-04 Thread Ralph Smith
like programming javascript. The code is right but the interpreter doesn't think so.) Thanks all, Ralph == On Jun 4, 2008, at 4:18 PM, GW wrote: -Original Message- From: [EMAIL PROTECTED] on behalf of Ralph Smith Sent: Wed 6/4/2008 4:04 PM To: pgs

Re: [GENERAL] Script errors on run

2008-06-04 Thread Gregory Williamson
: [EMAIL PROTECTED] on behalf of Ralph Smith Sent: Wed 6/4/2008 4:04 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Script errors on run Same problem, see below On Jun 4, 2008, at 3:30 PM, Stephan Szabo wrote: > On Wed, 4 Jun 2008, Ralph Smith wr

Re: [GENERAL] Script errors on run

2008-06-04 Thread Ralph Smith
Same problem, see below On Jun 4, 2008, at 3:30 PM, Stephan Szabo wrote: On Wed, 4 Jun 2008, Ralph Smith wrote: date_string := to_date(year||'-'||month||'-'||day , '-MM-DD') ; RAISE INFO 'date_string = %', date_string ; good_date := to_timestamp(date

Re: [GENERAL] Script errors on run

2008-06-04 Thread Stephan Szabo
On Wed, 4 Jun 2008, Ralph Smith wrote: >date_string := to_date(year||'-'||month||'-'||day , '-MM-DD') ; >RAISE INFO 'date_string = %', date_string ; >good_date := to_timestamp(date_string, '-MM-DD') ; >RAISE INFO 'good_date = %', good_date ; This seems like alot of extra

Re: [GENERAL] Script errors on run

2008-06-04 Thread Ralph Smith
On Jun 4, 2008, at 2:56 PM, Stephan Szabo wrote: On Wed, 4 Jun 2008, Ralph Smith wrote: -- == good_date := to_date(year||'-'||month||'-'||day , '-MM-DD') ; RAISE NOTICE 'good_date = %',good_date ; Usecs := EXTRACT(EPOCH FROM TIMESTAMP good

Re: [GENERAL] Script errors on run

2008-06-04 Thread Stephan Szabo
On Wed, 4 Jun 2008, Ralph Smith wrote: >-- == >good_date := to_date(year||'-'||month||'-'||day , '-MM-DD') ; >RAISE NOTICE 'good_date = %',good_date ; >Usecs := EXTRACT(EPOCH FROM TIMESTAMP good_date) ; > END ; > > QUERY: SELECT EXTR

[GENERAL] Script errors on run

2008-06-04 Thread Ralph Smith
This is my first 'real' script, one that verifies proper format for a user-entered date string. Once that is done I want the script to return the UNIX time. I plan on invoking this script on a psql connection (via .psqlrc), so that I can call it from the command line. Here's what I have at