pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Jewiss <Mark.Jewiss@knowledge.com>
To: John C Cusick <jcc2@juno.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] HOW DO I...
Date: Fri, 15 Oct 1999 14:14:03 +0100 (BST)
Message-ID: <Pine.BSO.4.10.9910151411550.13189-100000@office.knowledge.com> (raw)
In-Reply-To: <19991015.085403.-768299.0.jcc2@juno.com>

Hello,

On Fri, 15 Oct 1999, John C Cusick wrote:

> 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

Correct, the 'select into...' statement attempts to create the table, not
just insert rows.

I had this problem on a different system (which I haven't tried to do in
pgsql), where the solution was:

insert into tbl1
select * from tbl2 where this = that

I *think* you could declare a value list as in a normal insert. I also
think that this is SQL, not something specific to that db system, but I
may be wrong.

Regards,

Mark.
-- 
Mark Jewiss
Knowledge Matters Limited
http://www.knowledge.com




view thread (9+ messages)  latest in thread

Message-ID: <Pine.BSO.4.10.9910151411550.13189-100000@office.knowledge.com>
Permalink:  ../Pine.BSO.4.10.9910151411550.13189-100000@office.knowledge.com/
Also on:    postgresql.org/message-id/Pine.BSO.4.10.9910151411550.13189-100000@office.knowledge.com

 · 

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: Mark.Jewiss@knowledge.com, jcc2@juno.com
  Subject: Re: [SQL] HOW DO I...
  In-Reply-To: <Pine.BSO.4.10.9910151411550.13189-100000@office.knowledge.com>

* 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