Re: [GENERAL] Is This A Set Based Solution?

2007-03-18 Thread Tom Lane
Stefan Berglund <[EMAIL PROTECTED]> writes: > I tried this: > create or replace function foo(plist TEXT) > RETURNS SETOF Show_Entries as $$ > SELECT * > FROM Show_Entries > WHERE Show_ID = 1250 AND Show_Number IN ($1); > $$ LANGUAGE sql; > When I use select * from foo('101,110,115,120')

Re: [GENERAL] Is This A Set Based Solution?

2007-03-18 Thread Martijn van Oosterhout
On Thu, Mar 15, 2007 at 10:26:48AM -0700, Stefan Berglund wrote: > that PostgreSQL would allow a substitutable parameter in the IN clause. > However, it seems that it can't be done in this fashion without using > dynamic SQL unless I'm missing something. The substitutable list has to be an array,

Re: [GENERAL] Is This A Set Based Solution?

2007-03-18 Thread Stefan Berglund
On Sat, 10 Mar 2007 08:26:32 +0300 (MSK), oleg@sai.msu.su (Oleg Bartunov) wrote: in <[EMAIL PROTECTED]> >I don't know if you could change your schema. but I'd consider your >problem as a overlapping arrays task and use contrib/intarray for that. That's a nice piece of work, Oleg, and extremely

Re: [GENERAL] Is This A Set Based Solution?

2007-03-18 Thread Stefan Berglund
On Fri, 16 Mar 2007 09:38:52 -0300, [EMAIL PROTECTED] (Jorge Godoy) wrote: in <[EMAIL PROTECTED]> >Tino Wildenhain <[EMAIL PROTECTED]> writes: > >> Show me a user which really clicks on 1000 or more checkboxes on a >> webpage or similar ;) >> I'd think around 20 values is plenty. > >On the other

Re: [GENERAL] Is This A Set Based Solution?

2007-03-18 Thread Stefan Berglund
On Thu, 15 Mar 2007 15:46:33 -0500, [EMAIL PROTECTED] (Bruno Wolff III) wrote: in <[EMAIL PROTECTED]> >On Mon, Mar 12, 2007 at 11:15:01 -0700, > Stefan Berglund <[EMAIL PROTECTED]> wrote: >> >> I have an app where the user makes multiple selections from a list. I >> can either construct a hug

Re: [GENERAL] Is This A Set Based Solution?

2007-03-18 Thread Stefan Berglund
On Thu, 15 Mar 2007 09:47:27 -0500, [EMAIL PROTECTED] (George Weaver) wrote: in <[EMAIL PROTECTED]> > >Stefan Berglund wrote: > >> foo WHERE (ID = 53016 OR ID = 27 OR ID = 292 OR ID = 512) or I could >> alternatively pass the string of IDs ('53016,27,292,512') to a table >> returning function wh

Re: [GENERAL] Is This A Set Based Solution?

2007-03-16 Thread Jorge Godoy
Tino Wildenhain <[EMAIL PROTECTED]> writes: > Show me a user which really clicks on 1000 or more checkboxes on a > webpage or similar ;) > I'd think around 20 values is plenty. On the other hand, show me a page with 1000 or more checkboxes to be clicked at once and I'd show a developer / designer

Re: [GENERAL] Is This A Set Based Solution?

2007-03-16 Thread Tino Wildenhain
Bruno Wolff III schrieb: On Mon, Mar 12, 2007 at 11:15:01 -0700, Stefan Berglund <[EMAIL PROTECTED]> wrote: I have an app where the user makes multiple selections from a list. I can either construct a huge WHERE clause such as SELECT blah blah FROM foo WHERE (ID = 53016 OR ID = 27 OR ID = 292

Re: [GENERAL] Is This A Set Based Solution?

2007-03-15 Thread Bruno Wolff III
On Mon, Mar 12, 2007 at 11:15:01 -0700, Stefan Berglund <[EMAIL PROTECTED]> wrote: > > I have an app where the user makes multiple selections from a list. I > can either construct a huge WHERE clause such as SELECT blah blah FROM > foo WHERE (ID = 53016 OR ID = 27 OR ID = 292 OR ID = 512) or I

Re: [GENERAL] Is This A Set Based Solution?

2007-03-15 Thread George Weaver
Stefan Berglund wrote: foo WHERE (ID = 53016 OR ID = 27 OR ID = 292 OR ID = 512) or I could alternatively pass the string of IDs ('53016,27,292,512') to a table returning function which TABLE is then JOINed with the table I wish to Stefan, The user selections will be in some sort of list. C

Re: [GENERAL] Is This A Set Based Solution?

2007-03-15 Thread Stefan Berglund
On Mon, 12 Mar 2007 10:41:21 -0400, [EMAIL PROTECTED] (Tom Lane) wrote: in <[EMAIL PROTECTED]> >Stefan Berglund <[EMAIL PROTECTED]> writes: >> On Sat, 10 Mar 2007 00:37:08 -0500, [EMAIL PROTECTED] (Tom Lane) wrote: >>> It looks pretty ugly to me too, but you haven't explained your problem >>> cl

Re: [GENERAL] Is This A Set Based Solution?

2007-03-12 Thread Tom Lane
Stefan Berglund <[EMAIL PROTECTED]> writes: > On Sat, 10 Mar 2007 00:37:08 -0500, [EMAIL PROTECTED] (Tom Lane) wrote: >> It looks pretty ugly to me too, but you haven't explained your problem >> clearly enough for anyone to be able to recommend a better solution path. >> Why do you feel you need to

Re: [GENERAL] Is This A Set Based Solution?

2007-03-12 Thread Stefan Berglund
On Sat, 10 Mar 2007 08:26:32 +0300 (MSK), oleg@sai.msu.su (Oleg Bartunov) wrote: in <[EMAIL PROTECTED]> >I don't know if you could change your schema. but I'd consider your >problem as a overlapping arrays task and use contrib/intarray for that. > >Oleg I can very definitely change my schema at

[GENERAL] Is This A Set Based Solution?

2007-03-12 Thread Stefan Berglund
Hi- Below is a small test case that illustrates what I'm attempting which is to provide a comma separated list of numbers to a procedure which subsequently uses this list in a join with another table. My questions are is this a set based solution and is this the best approach in terms of using th

Re: [GENERAL] Is This A Set Based Solution?

2007-03-12 Thread Stefan Berglund
On Sat, 10 Mar 2007 00:37:08 -0500, [EMAIL PROTECTED] (Tom Lane) wrote: in <[EMAIL PROTECTED]> >Stefan Berglund <[EMAIL PROTECTED]> writes: >> Below is a small test case that illustrates what I'm attempting which is >> to provide a comma separated list of numbers to a procedure which >> subseque

Re: [GENERAL] Is This A Set Based Solution?

2007-03-09 Thread Tom Lane
Stefan Berglund <[EMAIL PROTECTED]> writes: > Below is a small test case that illustrates what I'm attempting which is > to provide a comma separated list of numbers to a procedure which > subsequently uses this list in a join with another table. > My questions are is this a set based solution and

Re: [GENERAL] Is This A Set Based Solution?

2007-03-09 Thread Oleg Bartunov
I don't know if you could change your schema. but I'd consider your problem as a overlapping arrays task and use contrib/intarray for that. Oleg On Fri, 9 Mar 2007, Stefan Berglund wrote: Hi- Below is a small test case that illustrates what I'm attempting which is to provide a comma separated

[GENERAL] Is This A Set Based Solution?

2007-03-09 Thread Stefan Berglund
Hi- Below is a small test case that illustrates what I'm attempting which is to provide a comma separated list of numbers to a procedure which subsequently uses this list in a join with another table. My questions are is this a set based solution and is this the best approach in terms of using th