[SQL] FW: Help- post gress sql error

2008-09-10 Thread Kota, Prasoona
Hi! I am receiving the following error when trying to execute sql Error: ERROR: ExecSubPlan: failed to find placeholder for subplan result (State:HY000, Native Code: 2C) - My query works fine in Oracle database without any issues. I have sub queries w

Re: [SQL] FW: Help- post gress sql error

2008-09-10 Thread Tom Lane
"Kota, Prasoona" <[EMAIL PROTECTED]> writes: > I am receiving the following error when trying to execute sql > Error: ERROR: ExecSubPlan: failed to find placeholder for subplan What Postgres version is that? If it's not a current minor release, please try updating, because I seem to remember hav

Re: [SQL] Function Syntax involving pipes and ' marks?

2008-09-10 Thread Bricklen Anderson
Ruben Gouveia wrote: v_where varchar(256) := 'where m.jb_date < '||p_date + integer '1'|| ' and m.jb_date >='||p_date||''; Try wrapping your p_date in a quote_literal like ... 'where m.jb_date < '||quote_literal(p_date+INTEGER '1')||' and ... eg. CREATE OR REPL

Re: [SQL] Function Syntax involving pipes and ' marks?

2008-09-10 Thread Bricklen Anderson
Ruben Gouveia wrote: Is that more expensive to run than just useing a bunch of ticks? Try wrapping your p_date in a quote_literal like ... 'where m.jb_date < '||quote_literal(p_date+INTEGER '1')||' and ... I personally have never noticed any increased overhead from quote_literal. -- Sent vi

Re: [SQL] Function Syntax involving pipes and ' marks?

2008-09-10 Thread Tom Lane
Bricklen Anderson <[EMAIL PROTECTED]> writes: > Ruben Gouveia wrote: >> Is that more expensive to run than just useing a bunch of ticks? > I personally have never noticed any increased overhead from quote_literal. Much more important is that you'll reliably get the right answer.

Re: [SQL] Function Syntax involving pipes and ' marks?

2008-09-10 Thread Ruben Gouveia
i will try that. thank you On Wed, Sep 10, 2008 at 11:45 AM, Tom Lane <[EMAIL PROTECTED]> wrote: > Bricklen Anderson <[EMAIL PROTECTED]> writes: > > Ruben Gouveia wrote: > >> Is that more expensive to run than just useing a bunch of ticks? > > > I personally have never noticed any increased overh

[SQL] pg_restore in java connection (auto_commit = false)

2008-09-10 Thread Emi Lu
Good afternoon, I have a question about pg_restore in JAVA and need your help. I planed to do: == 1. pg_dump each tables (done successfully) 2. start a java connection auto_commit = false 3.for(Table1... ... TableN) { drop primary key pg_restore table (dead lock

Re: [SQL] Function Syntax involving pipes and ' marks?

2008-09-10 Thread Ruben Gouveia
Is that more expensive to run than just useing a bunch of ticks? Sent from Apple iPhone 3G On Sep 10, 2008, at 11:24 AM, Bricklen Anderson <[EMAIL PROTECTED]> wrote: Ruben Gouveia wrote: v_where varchar(256) := 'where m.jb_date < '||p_date + integer '1'||

[SQL] Aggregates in WHERE clause?

2008-09-10 Thread Ruben Gouveia
I tried to do the following and got the following error message: select employee,count(distinct tasks) from job where greatest(max(last_job_date),max(last_position_date)) < 2008-08-28 + integer '1' group by employee; ERROR: aggregates not allowed in WHERE clause

Re: [SQL] Aggregates in WHERE clause?

2008-09-10 Thread Stephan Szabo
On Wed, 10 Sep 2008, Ruben Gouveia wrote: > I tried to do the following and got the following error message: > > select employee,count(distinct tasks) > from job > where greatest(max(last_job_date),max(last_position_date)) < > 2008-08-28 + integer '1' > group by employee; >

Re: [SQL] Aggregates in WHERE clause?

2008-09-10 Thread Richard Broersma
On Wed, Sep 10, 2008 at 4:11 PM, Ruben Gouveia <[EMAIL PROTECTED]> wrote: > select employee,count(distinct tasks) > from job > where greatest(max(last_job_date),max(last_position_date)) < > 2008-08-28 + integer '1' > group by employee; > > ERROR: aggregates not allowed in

Re: [SQL] pg_restore in java connection (auto_commit = false)

2008-09-10 Thread Craig Ringer
Emi Lu wrote: Good afternoon, I have a question about pg_restore in JAVA and need your help. I planed to do: == 1. pg_dump each tables (done successfully) 2. start a java connection auto_commit = false 3.for(Table1... ... TableN) { drop primary key pg_restore ta