From: | Rajesh Kumar Mallah <mallah(at)trade-india(dot)com> |
---|---|
To: | Jean-Luc Lachance <jllachan(at)nsd(dot)ca> |
Cc: | Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>, PostgResql SQL Mailing List <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Postgresql goes into recovery mode .... |
Date: | 2002-04-11 06:34:51 |
Message-ID: | 3CB52E8B.A7103324@trade-india.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
jeff i feel the second subselect is required becoz *without* the where
clause the
query:
UPDATE email_bank set userid=(select userid from t_a where
email_id=email_bank.email_id)
would have updated *all* records in email_bank (1 million) where as
i want to update only 35 K in those which are in t_a so "exists" is reqd.
i also feel UPDATE .. FROM is better Sql for this purpose which
can be written as:
update email_bank set userid=t_a.userid from t_a
where t_a.email_id = email_bank.email_id ;
the above also puts my SQL in abnormnal state.
Yes Jean UPDATE .. FROM works in 7.1.3.
acutally what i want to know is even if my SQL were wrong
what is the way out from the recovery mode? and less importantly
is my SQL really wrong?
regds
mallah.
Jean-Luc Lachance wrote:
> If I reacall, it (UPDATE ... FROM) does not work with 7.1.
> I think it was added only in 7.2.
>
> way is the only way with 7.1.
>
> Bottom line Rajesh: you should upgrade to 7.2.1
>
> JLL
>
> Jeff Eckermann wrote:
> >
> > I think the second subselect (in the EXISTS clause) is
> > not necessary, as it will always return true if the
> > where clause in the first subselect (in the SET
> > clause) is satisfied.
> >
> > Another way to write it (untested):
> > update email_bank set userid = t_a.userid
> > where email_id = t_a.email_id;
> >
> > --- Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
> (consult mailing list )
From | Date | Subject | |
---|---|---|---|
Next Message | Rajesh Kumar Mallah | 2002-04-11 06:46:32 | Re: new problem! Is there any Faster workaround ?? |
Previous Message | Tom Lane | 2002-04-11 02:10:07 | Re: View INSERTs not returning OID in Postgres 7.2.1 |