[GENERAL] Re: SELECT from record-returning function causes function code to be executed multiple times

2013-12-15 Thread David Johnston
dbaston wrote > I'm wondering if this is expected behavior? Yes. The proper way to handle this is by putting the SRF in the FROM clause. If you must have it in the select clause you should do this: WITH srf_call ( SELECT srf_function() AS srf_result ) SELECT (srf_call.srf_result).* FROM srf_ca

RE: [GENERAL] Re: SELECT FOR UPDATE

2001-08-27 Thread Glen Parker
> On 26 Aug 2001 13:50:16 -0700, Cody <[EMAIL PROTECTED]> wrote: > > I just finished reading Bruce M's book, so this thread confuses me, > > esp. Jan's posts. I take full heed of the need for application level > > user/thread management, but I was interested in using a parallel > > set-up in PG (

[GENERAL] Re: SELECT FOR UPDATE

2001-08-27 Thread Lee Harr
On 26 Aug 2001 13:50:16 -0700, Cody <[EMAIL PROTECTED]> wrote: > I just finished reading Bruce M's book, so this thread confuses me, > esp. Jan's posts. I take full heed of the need for application level > user/thread management, but I was interested in using a parallel > set-up in PG (however re

RE: [GENERAL] Re: SELECT FOR UPDATE

2001-08-23 Thread Andrew Snow
I prefer the way Notes (for example) handles it. All records/documents/views are in read-only mode until the user indicates they actually want to edit. They then exclusively lock that record for editing, with optional timeouts (in case their workstation crashes or whatever). This turns out to

[GENERAL] Re: SELECT FOR UPDATE

2001-08-23 Thread Gregory Wood
> >But the question itself tells that you're about to implement > >a major design error in your application. Holding database > >locks during user interaction IS A BAD THING. Never, never > >ever do it that way. And anybody telling you something > >diffe

Re: [GENERAL] Re: select to combine 2 tables

2001-06-22 Thread Trond Eivind Glomsrød
"Thomas T. Thai" <[EMAIL PROTECTED]> writes: > On Fri, 22 Jun 2001, Tom Lane wrote: > > > "Thomas T. Thai" <[EMAIL PROTECTED]> writes: > > >> Use a union query: > > >> > > >> select rec_id, path, '' as link, name from cat_cat > > >> UNION > > >> select rec_id, path, link, name from cat_alias >

Re: [GENERAL] Re: select to combine 2 tables

2001-06-22 Thread Thomas T. Thai
On Fri, 22 Jun 2001, Tom Lane wrote: > "Thomas T. Thai" <[EMAIL PROTECTED]> writes: > >> Use a union query: > >> > >> select rec_id, path, '' as link, name from cat_cat > >> UNION > >> select rec_id, path, link, name from cat_alias > > > there is no way to do this in a generic DBI way? i need f

Re: [GENERAL] Re: select to combine 2 tables

2001-06-22 Thread Tom Lane
"Thomas T. Thai" <[EMAIL PROTECTED]> writes: >> Use a union query: >> >> select rec_id, path, '' as link, name from cat_cat >> UNION >> select rec_id, path, link, name from cat_alias > there is no way to do this in a generic DBI way? i need for this to work > across diff kind of DBs. Huh? That

[GENERAL] Re: select to combine 2 tables

2001-06-22 Thread Thomas T. Thai
On Fri, 22 Jun 2001 [EMAIL PROTECTED] wrote: > > > Use a union query: > > select rec_id, path, '' as link, name from cat_cat > UNION > select rec_id, path, link, name from cat_alias there is no way to do this in a generic DBI way? i need for this to work across diff kind of DBs. > > Notice

[GENERAL] Re: Select

2001-04-17 Thread mike
SELECT * FROM employee WHERE empname LIKE 'P%' the above would work only if you want to search for people w/ names starting w/ P Mike - Original Message - From: "Marcelo Pereira" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 17, 2001 5:23 AM Subject: Select > Hi All

Re: [GENERAL] Re: SELECT (sometimes) returning Zero Rows?

2001-02-13 Thread Christopher Sawtell
On Wed, 14 Feb 2001 15:03, you wrote: > It's version 7.0.3 > > Here's the output for the selects using explain below. > We had planned to do all of the optimization later. We just haven't had > time to get to it yet. Could that be the problem? > > Anyhow here's the info. Please let me know if you

[GENERAL] Re: SELECT (sometimes) returning Zero Rows?

2001-02-13 Thread Matt Friedman
It's version 7.0.3 Here's the output for the selects using explain below. We had planned to do all of the optimization later. We just haven't had time to get to it yet. Could that be the problem? Anyhow here's the info. Please let me know if you need more information. Appreciatively, Matt Fried

[GENERAL] Re: Select in function?

2001-02-07 Thread Alfonso Peniche
Thanks all, it's working great now. Cheers. :-) [EMAIL PROTECTED] wrote: > As per the documentation at: > http://postgresql.planetmirror.com/users-lounge/docs/7.0/user/c40874113.htm#AEN4207 > > When using SELECT in a PL/PGSQL function, you must either SELECT .. INTO or > use the PERFORM query i

[GENERAL] Re: select question -- SOLVED

2000-07-31 Thread Felipe Alvarez Harnecker
Tom Lane writes: > Felipe Alvarez Harnecker <[EMAIL PROTECTED]> writes: > > Hi, I wonder if one must activate the LIMIT clause somewhere, > > uh ... no ... > > > bacause for me it does nothing. > > Details? What query did you issue exactly, and what did you get? > >

[GENERAL] Re: select question

2000-07-31 Thread Tom Lane
Felipe Alvarez Harnecker <[EMAIL PROTECTED]> writes: > Hi, I wonder if one must activate the LIMIT clause somewhere, uh ... no ... > bacause for me it does nothing. Details? What query did you issue exactly, and what did you get? regards, tom lane

[GENERAL] Re: select question

2000-07-31 Thread Felipe Alvarez Harnecker
Tom Lane writes: > g <[EMAIL PROTECTED]> writes: > > Use the limit clause. > > SELECT message_text FROM messages ORDER BY creation_date LIMIT $limit, > > $offset. > > > LIMIT 10, 0 gets you the first batch. > > LIMIT 10, 10 gets you the second batch. > > LIMIT 10, 20 gets you the third,