pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jerome Raupach <jraupach@intelcom.fr>
To: Ian Turner <vectro@pipeline.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: work on some tables in the same time.
Date: Wed, 13 Sep 2000 17:58:05 +0200
Message-ID: <39BFA40D.176D3FC@intelcom.fr> (raw)
References: <Pine.LNX.4.21.0009130845070.1180-100000@crafter.house>

Thanks, but:

testdb=#CREATE VIEW tableselecttemp AS SELECT DISTINCT f1, f2, f3 FROM
table1_n;
ERROR:  DISTINCT not supported in views

Jerome.


Ian Turner wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> > I want to execute this query on some table2 in the same time :
> >
> > INSERT INTO table2_n(f1, f2, f3)
> >       SELECT DISTINCT f1, f2, f3 FROM table1_n ;
> 
> One way would be to do:
> BEGIN
> CREATE VIEW tableselecttemp AS
>         SELECT DISTINCT f1, f2, f3 FROM table1_n;
> INSERT INTO table2_n(f1, f2, f3) SELECT * FROM tableselecttemp;
> INSERT INTO table2  (f1, f2, f3) SELECT * FROM tableselecttemp;
> DROP VIEW tableselecttemp;
> ROLLBACK;
> 
> Alternatively, run the select query twice without the temporary
> view. You'll have to try it both ways, on a realistic data set, to see
> which is faster for you.
> 
> Ian
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.1 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
> 
> iD8DBQE5v6HGfn9ub9ZE1xoRAuo0AJwNCXhjE4WWH0WMeZrLZCjrR/H37ACZAR4N
> FkuWQ4rEUUMI6bCcZkCU3XA=
> =q6gb
> -----END PGP SIGNATURE-----



view thread (5+ messages)  latest in thread

Message-ID: <39BFA40D.176D3FC@intelcom.fr>
Permalink:  ../39BFA40D.176D3FC@intelcom.fr/
Also on:    postgresql.org/message-id/39BFA40D.176D3FC@intelcom.fr

 · 

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: jraupach@intelcom.fr, vectro@pipeline.com
  Subject: Re: work on some tables in the same time.
  In-Reply-To: <39BFA40D.176D3FC@intelcom.fr>
  References: <Pine.LNX.4.21.0009130845070.1180-100000@crafter.house> <39BFA40D.176D3FC@intelcom.fr>

* 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