Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BCE7B2E009A for ; Thu, 20 Mar 2008 11:30:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 70137-04 for ; Thu, 20 Mar 2008 11:30:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.182]) by postgresql.org (Postfix) with ESMTP id C4D2D2E0084 for ; Thu, 20 Mar 2008 11:30:40 -0300 (ADT) Received: by el-out-1112.google.com with SMTP id z25so764409ele.0 for ; Thu, 20 Mar 2008 07:30:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=nMc4WolrNVz8kXZbf06g8hRjhXQjTIkLwZDut88wM8I=; b=XoI1ZZzfZR+fTAQEIXXbigqn74LonU5DSlk4xwGOFuyv0QpDEZfW/WRsfu8uUTr4Apvg9ZP3ENDpoezteboVuwVUK/rL+IIcp0IfQDe6mF953NaHzkPfRITz6/82JKUJa1QFN9iKnvaSjm+pc/9TFrL+Iqnpa+GRzvWXW6lic5I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ga4fsrkuzXG/+sp73xMSTAdJb8aQRQ4aqcfrzLvV8dJ4/V14ugazgEokGns5RCf/H0PXrqYdaLyCOSXn0mOHLo1AUER5PUj9y27qhdOvrOQQ3E27IJ+HRpoujHhZsYCVohXX6I3OZMwhPZ5VCTo/etriJ+s4TBmpl8liZZtzbo0= Received: by 10.115.18.1 with SMTP id v1mr3658556wai.81.1206023438987; Thu, 20 Mar 2008 07:30:38 -0700 (PDT) Received: by 10.114.27.16 with HTTP; Thu, 20 Mar 2008 07:30:38 -0700 (PDT) Message-ID: <65937bea0803200730j6e45ba51raeb7df564e49177a@mail.gmail.com> Date: Thu, 20 Mar 2008 20:00:38 +0530 From: "Gurjeet Singh" To: Joe Subject: Re: Select into Cc: "Gavin 'Beau' Baumanis" , pgsql-sql@postgresql.org In-Reply-To: <47E268CF.3040604@freedomcircle.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_15066_16454457.1206023438985" References: <94F93C0F-DA95-4435-B253-57C90961DF34@eclinic.com.au> <20080320104922.GB18935@a-kretschmer.de> <65937bea0803200358i290bdc87hdeca777b593b5df1@mail.gmail.com> <786D2B38-CE0A-41BF-9E70-4DEB22F8D9EF@eclinic.com.au> <47E25447.6040109@freedomcircle.net> <65937bea0803200613k4593da12hd62233f8a745309@mail.gmail.com> <47E268CF.3040604@freedomcircle.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/150 X-Sequence-Number: 30478 ------=_Part_15066_16454457.1206023438985 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu, Mar 20, 2008 at 7:08 PM, Joe wrote: > Gurjeet Singh wrote: > > Except that it doesn't work... Did you try to execute that query; I am > > assuming not. > Of course I did, My bad... I did not run your query either, and based my assumption on my previous attempt that had thrown an error. Here's something similar to what had failed in my previous attemt: update t1 *as e1* set e1.col2 =3D t1copy.col2, e1.col3 =3D t1copy.col3 from t1 as t1copy where e1.col1 =3D 1 and t1copy.col1 =3D 3; As you can see, I had aliased the main table t1, and hence the error. Best regards, --=20 gurjeet[.singh]@EnterpriseDB.com singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com EnterpriseDB http://www.enterprisedb.com 17=B0 29' 34.37"N, 78=B0 30' 59.76"E - Hyderabad * 18=B0 32' 57.25"N, 73=B0 56' 25.42"E - Pune 37=B0 47' 19.72"N, 122=B0 24' 1.69" W - San Francisco http://gurjeet.frihost.net Mail sent from my BlackLaptop device ------=_Part_15066_16454457.1206023438985 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu, Mar 20, 2008 at 7:08 PM, Joe <dev@freedomcircle.net> wrote:
<= blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 2= 04, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Gurjeet Singh wrote:
> Except that it doesn't work... Did you try to execute that query; = I am
> assuming not.
Of course I did,

My bad... I did not run your = query either, and based my assumption on my previous attempt that had throw= n an error. Here's something similar to what had failed in my previous = attemt:

update t1  as e1 set e1.col2 =3D t1copy.col2, e1.col3 =3D t= 1copy.col3
from t1 as t1copy
where e1.col1 =3D 1 and t1copy.col1 =3D = 3;


    As you can see, I had aliased the main tab= le t1, and hence the error.

Best regards,

--
gurjeet[.singh]@EnterpriseDB.= com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

En= terpriseDB http://www.enterprisedb.= com

17=B0 29' 34.37"N, 78=B0 30' 59.76"E - Hyderabad *18=B0 32' 57.25"N, 73=B0 56' 25.42"E - Pune
37=B0 47&= #39; 19.72"N, 122=B0 24' 1.69" W - San Francisco

http://gurjeet.frihost.net

Mail sent from my BlackLaptop device ------=_Part_15066_16454457.1206023438985--