Re: [SQL] [GENERAL] How to split a table?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: [SQL] [GENERAL] How to split a table?
Date: 2006-10-17 09:12:38
Message-ID: 20061017091237.GA19268@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice pgsql-sql

am Tue, dem 17.10.2006, um 1:53:35 -0700 mailte Gregory S. Williamson folgendes:
> Perhaps something like:
>
> CREATE TABLE foo2 AS SELECT * FROM foo WHERE (rand() <= 0.60);

Then we have 2 tables: one with 100% data and one with around 60% ;-)
If the table contains a primary key you can delete simple the copied
records from the origin table.

(delete from origin where pk in (select pk from copy);

>
> -----Original Message-----

Please, no top-posting with fullquote below.

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory S. Williamson 2006-10-17 09:19:47 Re: [SQL] [GENERAL] How to split a table?
Previous Message Achilleas Mantzios 2006-10-17 09:09:59 Re: [GENERAL] How to split a table?

Browse pgsql-novice by date

  From Date Subject
Next Message Gregory S. Williamson 2006-10-17 09:19:47 Re: [SQL] [GENERAL] How to split a table?
Previous Message Achilleas Mantzios 2006-10-17 09:09:59 Re: [GENERAL] How to split a table?

Browse pgsql-sql by date

  From Date Subject
Next Message Gregory S. Williamson 2006-10-17 09:19:47 Re: [SQL] [GENERAL] How to split a table?
Previous Message Achilleas Mantzios 2006-10-17 09:09:59 Re: [GENERAL] How to split a table?