pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mathijs Brands <mathijs@ilse.nl>
To: John C Cusick <jcc2@juno.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] HOW DO I...
Date: Fri, 15 Oct 1999 15:23:10 +0200
Message-ID: <19991015152309.A1841@ilse.nl> (raw)
In-Reply-To: <19991015.085403.-768299.0.jcc2@juno.com>
References: <19991015.085403.-768299.0.jcc2@juno.com>

On Fri, Oct 15, 1999 at 08:54:01AM -0400, John C Cusick allegedly wrote:
> To All,
> 
> How do I select from one table into another table
> that already exists?
> 
> In other words, if I do a:
> select * into tblB from tblA where attrN like 'xxx';
> 
> and both table structures are identical I get a
> ERROR: Relation 'tblB' already exists
> 
> If I : select * into table tblB from tblA where attrN like 'xxx';
> 
> I get the same answer.
> 
> I also tried using 'update'
> 
> So, How do I update a smaller table from a larger table?
> 
> For those who wish to know, This is a large parts database that
> is updated monthly and I have divided it into smaller subsections for
> quick access through a web-based interface. Searching the original
> table is much too time consuming ( over 130,000 part #'s with Specs and
> Descriptions - all running on an ancient 80386).  And I would like 
> to avoid updating the smaller tables by re-building them from scratch.
> 
> Thanks for your time,
> 
> John C.

Shouldn't you be doing the following?

insert into tblB select * from tblA where attrN like 'xxx';

Mathijs



view thread (9+ messages)  latest in thread

Message-ID: <19991015152309.A1841@ilse.nl>
Permalink:  ../19991015152309.A1841@ilse.nl/
Also on:    postgresql.org/message-id/19991015152309.A1841@ilse.nl

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mathijs@ilse.nl, jcc2@juno.com
  Subject: Re: [SQL] HOW DO I...
  In-Reply-To: <19991015152309.A1841@ilse.nl>

* 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