am Wed, dem 18.04.2007, um 21:59:35 -0700 mailte chrisj folgendes:
>
> I would like to do a selective export of a number of tables from a large
> database to import into a smaller (test) DB.
>
> I know about: psql dbname -tc "select * from tableX where whatever" >
> tableX.dat
>
> but unless I put it through a sed script, this file cannot be easily used
> for import.
>
> It feels like I am re-inventing the wheel. Does anybody know a better way
> or have a good sed script.
If you have 8.2, than you can use COPY also for VIEWs or for SELECTS.
If not, create a temp. table as result for your SELECT and COPY this
temp. table instead the original table.
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net