pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: John J. Boris, Sr. <john.boris@onlinesvc.com>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Does PostgreSQL have an UPDATE Function like UNIFY?
Date: Sun, 30 May 1999 16:13:46 +0300
Message-ID: <l03130303b376e90c1682@[147.233.159.109]> (raw)
In-Reply-To: <4.1.19990528202544.00a652c0@bcs-main.onlinesvc.com>

At 03:34 +0300 on 29/05/1999, John J. Boris, Sr. wrote:


> I can delete the records and then add them but I think that
> might be a bit time consuming.

Frankly, I don't think it will be more time consuming. Supposing a COPY
command had to do it itself, it would have to look up each record in the
table, and replace it. So it would probably mark the old one as deleted and
insert the new record. It shouldn't be much faster than:

1) Creating a temp table with the same schema as the main one
2) copying the records into the temp table
3) deleting from the main all the records which exist in the temp
   table (DELETE FROM main WHERE main.field = temp.field);
4) Inserting all records from the temp table using INSERT INTO... SELECT.
5) Dropping the temp table
6) Vacuuming

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma





view thread (5+ messages)  latest in thread

Message-ID: <l03130303b376e90c1682@[147.233.159.109]>
Permalink:  ../l03130303b376e90c1682@%5B147.233.159.109%5D/
Also on:    postgresql.org/message-id/l03130303b376e90c1682@[147.233.159.109]

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: herouth@oumail.openu.ac.il, john.boris@onlinesvc.com
  Subject: Re: [SQL] Does PostgreSQL have an UPDATE Function like UNIFY?
  In-Reply-To: <l03130303b376e90c1682@[147.233.159.109]>
  References: <4.1.19990528202544.00a652c0@bcs-main.onlinesvc.com> <l03130303b376e90c1682@[147.233.159.109]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox