Re: [SQL] function returning array

2004-04-13 Thread Joe Conway
Dennis wrote: I am trying to return an array from a function and don't seem to be having luck. The function seems to work fine, but if I do assignment to an array variable, I get null in the array elements DECLARE results varchar[]; tmpv varchar; BEGIN -- now call func that returns varchar

Re: [SQL] function returning array

2004-04-13 Thread Tom Lane
"Dennis" <[EMAIL PROTECTED]> writes: > I am trying to return an array from a function and don't seem to be having > luck. Seems to work for me ... what PG version are you using? regression=# create function parseString() returns varchar[] as regression-# 'begin return \'{abc,def,ghi}\'; end' lan

[SQL] function returning array

2004-04-13 Thread Dennis
I am trying to return an array from a function and don't seem to be having luck. The function seems to work fine, but if I do assignment to an array variable, I get null in the array elements DECLARE results varchar[]; tmpv varchar; BEGIN -- now call func that returns varchar[] results

Re: [SQL] trigger/for key help

2004-04-13 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: >>> Is there a reason postgres goes out of its way to pick names that >>> will be harder to work with than necessary? > I don't see an unseverable link between "user name space" and "identifiers > that don't need to be quoted". Mixed case names for instance s

Re: [SQL] Formatting Functions and Group By

2004-04-13 Thread Terry Brick
Thank you both for your responses. That's just what I needed and thanks for catching my mistake Tom. And may I say that I am VERY happy to be moving to Postgres. The lack of a native Win32 version was thing only thing holding us back from Postgres previously. I think this is the only kin

Re: [SQL] trigger/for key help

2004-04-13 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Greg Stark <[EMAIL PROTECTED]> writes: > > Is there a reason postgres goes out of its way to pick names that > > will be harder to work with than necessary? > > If we use ordinary identifiers for system-generated names then we will > be infringing on user na

Re: [SQL] Formatting Functions and Group By

2004-04-13 Thread Tom Lane
Terry Brick <[EMAIL PROTECTED]> writes: > I'm porting a bunch of queries from MySQL to Postgres 7.4 and am having a problem > with one > particular area. For example, a query like this works in MySQL: > select > to_char(myCol,'Mon YY') > from > myTable > group by > to_char(myCol,'MM ')

Re: [SQL] Formatting Functions and Group By

2004-04-13 Thread Bruno Wolff III
On Tue, Apr 13, 2004 at 09:13:05 -0700, Terry Brick <[EMAIL PROTECTED]> wrote: > Hi, > I'm porting a bunch of queries from MySQL to Postgres 7.4 and am having a problem > with one > particular area. For example, a query like this works in MySQL: > > select > to_char(myCol,'Mon YY') > from >

[SQL] Formatting Functions and Group By

2004-04-13 Thread Terry Brick
Hi, I'm porting a bunch of queries from MySQL to Postgres 7.4 and am having a problem with one particular area. For example, a query like this works in MySQL: select to_char(myCol,'Mon YY') from myTable group by to_char(myCol,'MM ') order by to_char(myCol,'MM ') Postgres will gi

Re: [SQL] trigger/for key help

2004-04-13 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > Is there a reason postgres goes out of its way to pick names that > will be harder to work with than necessary? If we use ordinary identifiers for system-generated names then we will be infringing on user name space --- ie, there's a potential for conflict.

Re: [SQL] cursors and for loops?

2004-04-13 Thread Richard Huxton
On Sunday 11 April 2004 19:46, Dennis wrote: > Tom Lane writes: > > Something like > > > > LOOP > > FETCH ...; > > EXIT WHEN NOT found; > > ... > > END LOOP; > > Thank you! I tried finding documentation on "found" in this context and > didn't come up with