pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Good <tomg@admin.nrnet.org>
To: Herouth Maoz <herouth@oumail.openu.ac.il>
Cc: PostgreSQL List <pgsql-sql@postgreSQL.org>
Subject: Using the IN predicate in an UPDATE...
Date: Wed, 14 Oct 1998 09:06:01 -0400 (EDT)
Message-ID: <Pine.LNX.3.96.981014085503.5064A-100000@admin.nrnet.org> (raw)
In-Reply-To: <l03110700b24a22c17e45@[194.90.105.243]>

Herouth,

This query takes 20 years (poetic licence invoked ;-).
Do you have a smarter way to accomplish this end:

UPDATE table1 SET id = 2
WHERE rec_num IN
 ( SELECT rec_num 
   FROM table1
   WHERE id = 1
  );     

This is an attempt to cleanup some user error...I have an old
foxpro db that uses a char str as an index and this index has no
check constraints (like, making the index unique...ouch.)
The new pg db is performing nicely, now that it's live...and 
housing 12 years worth of data.  But I am saddled with quite a bit
of housekeeping - correcting anomalies that were part and parcel
of the original (foxpro) design.  Or absence thereof.

Thanks much!
Tom

    ---------- Sisters of Charity Medical Center ----------
                   Department of Psychiatry
                            ----     
    Thomas Good                          <tomg@q8.nrnet.org>
    Coordinator, North Richmond C.M.H.C. Information Systems
    75 Vanderbilt Ave, Quarters 8        Phone: 718-354-5528
    Staten Island, NY   10304            Fax:   718-354-5056





view thread (6+ messages)  latest in thread

Message-ID: <Pine.LNX.3.96.981014085503.5064A-100000@admin.nrnet.org>
Permalink:  ../Pine.LNX.3.96.981014085503.5064A-100000@admin.nrnet.org/
Also on:    postgresql.org/message-id/Pine.LNX.3.96.981014085503.5064A-100000@admin.nrnet.org

 · 

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: tomg@admin.nrnet.org, herouth@oumail.openu.ac.il
  Subject: Re: Using the IN predicate in an UPDATE...
  In-Reply-To: <Pine.LNX.3.96.981014085503.5064A-100000@admin.nrnet.org>
  References: <l03110700b24a22c17e45@[194.90.105.243]> <Pine.LNX.3.96.981014085503.5064A-100000@admin.nrnet.org>

* 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