Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C65212E0041 for ; Thu, 20 Mar 2008 07:58:12 -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 97526-01 for ; Thu, 20 Mar 2008 07:58:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by postgresql.org (Postfix) with ESMTP id 492092E0039 for ; Thu, 20 Mar 2008 07:58:09 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id m38so1004083waf.5 for ; Thu, 20 Mar 2008 03:58:08 -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=WycuUWlqse1VbboZzMNd2U7/VPYhUoWIEUEQSYAoyu4=; b=HPbl31qKuzXWmocsxjZgcXj3YTZMOSVRGbzDTcRjlyH0gH8cExa1R39UBvaLsHFSUmqE2cBCUU1xy95JdnkKcd9SJbP7QrAlpR78hEn+7SkrIauy6CDzd4n+lsE7iDfJ4ED3gSMnVOjfrqFgv8l7paDVE2RRAuRj7A7HYLRyXAQ= 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=XgOwPZ9y9jtletTmCDXeBawqxuzTGhJwhHU+w9nDAITk8StK1UjHC+6JXnngcyyz659u3YPrurHf1ptzznl0FsLc/TdfDHqHHeieUmhPmY7Q5AQXEkN61a/cRg7g97rtTeWgSfo/kuaHkoA0yLfg7OABKh13vYGoKhkRNUcVryw= Received: by 10.114.175.16 with SMTP id x16mr3290421wae.12.1206010687773; Thu, 20 Mar 2008 03:58:07 -0700 (PDT) Received: by 10.114.27.16 with HTTP; Thu, 20 Mar 2008 03:58:07 -0700 (PDT) Message-ID: <65937bea0803200358i290bdc87hdeca777b593b5df1@mail.gmail.com> Date: Thu, 20 Mar 2008 16:28:07 +0530 From: "Gurjeet Singh" To: "Gavin 'Beau' Baumanis" Subject: Re: Select into Cc: pgsql-sql@postgresql.org, "A. Kretschmer" In-Reply-To: <20080320104922.GB18935@a-kretschmer.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_14040_20666598.1206010687759" References: <94F93C0F-DA95-4435-B253-57C90961DF34@eclinic.com.au> <20080320104922.GB18935@a-kretschmer.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/134 X-Sequence-Number: 30462 ------=_Part_14040_20666598.1206010687759 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu, Mar 20, 2008 at 4:19 PM, A. Kretschmer < andreas.kretschmer@schollglas.com> wrote: > am Thu, dem 20.03.2008, um 20:57:53 +1100 mailte Gavin 'Beau' Baumanis > folgendes: > > Hi Everyone, > > > > I have asked our DBA at work and h is not too sure either... so I > > thought it best to on the list. > > > > Basically, what I am after is a way to copy the contents of one record > > into another. > > Something like select into; but where the destination record already > > exists, as opposed to creating a new record. > > insert into select from
where ... > > He specifically asked for where the destination record already exists, as opposed to creating a new record. I think an UPDATE with joins would be helpful. Though, it may become lengthy if the tables have too many columns. Can you post your exact requirement? --=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_14040_20666598.1206010687759 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu, Mar 20, 2008 at 4:19 PM, A. Kretschmer <andreas.kretschmer@schollglas.com> wrot= e:
am  Thu, dem 20.03.2008, um 20:57:53 +1100 mailte Gavin 'Beau'= Baumanis folgendes:
> Hi Everyone,
>
> I have asked our DBA at work and h is not too sure either... so I
> thought it best to on the list.
>
> Basically, what I am after is a way to copy the contents of one record=
> into another.
> Something like select into; but where the destination record already > exists, as opposed to creating a new record.

insert into <table> select from <table> where ...

=

He specifically asked for

<snip>
where the destination record already
exists, as opposed to creating a n= ew record.

</snip>


    I think an UPDATE with join= s would be helpful. Though, it may become lengthy if the tables have too ma= ny columns.

    Can you post your exact requirement?<= br>
--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | india= times | 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&#= 39; 19.72"N, 122=B0 24' 1.69" W - San Francisco

http://gurjeet.frihost.net

Mail= sent from my BlackLaptop device ------=_Part_14040_20666598.1206010687759--