Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-28 Thread Tom Lane
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > On Sat, Sep 28, 2002 at 11:51:32PM -0400, Bruce Momjian wrote: >> Yes, it will split now() and CURRENT_TIMESTAMP. I personally would be >> happy with STATEMENT_TIMESTAMP, but because the standard requires it we >> may just have to fix CURRENT_T

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-28 Thread Bruce Momjian
Martijn van Oosterhout wrote: > On Sat, Sep 28, 2002 at 11:28:03PM -0400, Bruce Momjian wrote: > > > > OK, we have two db's returning statement start time, and Oracle 8 not > > having CURRENT_TIMESTAMP. > > > > Have we agreed to make CURRENT_TIMESTAMP statement start, and now() > > transaction s

Re: [SQL] [GENERAL] CURRENT_TIMESTAMP

2002-09-28 Thread Bruce Momjian
OK, we have two db's returning statement start time, and Oracle 8 not having CURRENT_TIMESTAMP. Have we agreed to make CURRENT_TIMESTAMP statement start, and now() transaction start? Is this an open item or TODO item? ---

Re: [SQL] SQL formatter?

2002-09-28 Thread Andrew G. Hammond
There's a tool called TXL that, given an SQL grammar can pretty print it. (a semantically aware code transformation tool is massive overkill for the job, but what the hell... :) Andrew Perrin wrote: >Unfortunately it is Windows based. The emacs mode for SQL is pretty >primitive too. Oh well -

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Bruce Momjian
Tom Lane wrote: > Roland Roberts <[EMAIL PROTECTED]> writes: > > What can we do to at least get this on the radar screen as a known > > bug? > > Oh, it's on the radar screen all right. Who wants to step up and fix > it? Do we need a TODO for it? -- Bruce Momjian| ht

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Tom Lane
Roland Roberts <[EMAIL PROTECTED]> writes: > What can we do to at least get this on the radar screen as a known > bug? Oh, it's on the radar screen all right. Who wants to step up and fix it? regards, tom lane ---(end of broadcast)---

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Tom Lane
Ian Barwick <[EMAIL PROTECTED]> writes: > On Friday 27 September 2002 18:04, Josh Berkus wrote: >> Currently, if you want to use an array, it has to be passed as a >> parameter, or come from an external table. You cannot declare an >> Array data type. Annoying, really. > If I replace the retur

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Roland Roberts
> "Greg" == Greg Johnson <[EMAIL PROTECTED]> writes: Greg> CREATE FUNCTION test_array( ) RETURNS VARCHAR[] AS ' Greg> DECLARE Greg> return_array VARCHAR[]; Greg> BEGIN Greg> return_array[0] := ''test''; Greg> return_array[1] := ''test 1''; Greg> re

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Ian Barwick
On Friday 27 September 2002 18:04, Josh Berkus wrote: > Greg, > > > CREATE FUNCTION test_array( ) RETURNS VARCHAR[] AS ' > > DECLARE > > return_array VARCHAR[]; > > BEGIN > > return_array[0] := ''test''; > > return_array[1] := ''test 1''; > > return_array[2] := ''test 2''; > > RETU

Re: [GENERAL] [SQL] function return multiply rows

2002-09-28 Thread Alvaro Herrera
En Fri, 27 Sep 2002 09:44:55 -0700 Joe Conway <[EMAIL PROTECTED]> escribió: > Jeroen Olthof wrote: > > vw_teams is a view but same problem when trying it on a single table > > CREATE FUNCTION test() RETURNS SETOF vw_teams AS 'select * from vw_teams;' > > LANGUAGE 'sql'; > > > > SELECT test(); >

Re: [SQL] Case Sensitive "WHERE" Clauses?

2002-09-28 Thread Kevin Houle
Jordan Reiter wrote: > Are string comparisons in postgresql case sensitive? > > I keep on having this response: > > SELECT * > FROM People > WHERE first_name='jordan' > > Result: 0 records > > SELECT * > FROM People > WHERE first_name='Jordan' > > Result: 1 record It's case-sensitive. You ca

Re: [SQL] Passing array to PL/SQL and looping

2002-09-28 Thread Greg Johnson
Is it possible to construct and return an array with plpgsql like.. CREATE FUNCTION test_array( ) RETURNS VARCHAR[] AS ' DECLARE     return_array VARCHAR[]; BEGIN     return_array[0] := ''test'';     return_array[1] := ''test 1'';     return_array[2] := ''test 2''; RETURN (return_array); EN