Thread: ps_dump -a
Running PostgreSQL 7.2.1 on RedHat Linux 7.2:
I'm trying to do a "pg_dump -a -t t_table -d testdb > out.txt"
and I'm still getting header information. How can I do
a dump of data to a text file and not get information like
the comments, Date for TOC Entry, Name, etc ... I just
want the raw data. I've tried to pipe it through using
tail, but I don't know if I'm missing the beginning of the
file.
Thanks!
-X
On Tue, Oct 29, 2002 at 10:24:48AM -0500, Johnson, Shaunn wrote: > Running PostgreSQL 7.2.1 on RedHat Linux 7.2: > > I'm trying to do a "pg_dump -a -t t_table -d testdb > out.txt" > and I'm still getting header information. How can I do > a dump of data to a text file and not get information like > the comments, Date for TOC Entry, Name, etc ... I just > want the raw data. I've tried to pipe it through using > tail, but I don't know if I'm missing the beginning of the > file. What about pg_dump -a -t t_table -d testdb | grep -v "^--" > out.txt ? The grep will get rid of any line that begins with "-", which will be a comment line. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.info> M2P 2A8 +1 416 646 3304 x110
--thanks for the reply:
--that could work, i'll give it a try now ...
--but now ... am i not clear as to what the '-a' is suppose
--to provide? shouldn't there be a text file with
--just data or is this a bug of some sort?
--thanks again!
-X
-----Original Message-----
From: Andrew Sullivan [mailto:andrew@libertyrms.info]
On Tue, Oct 29, 2002 at 10:24:48AM -0500, Johnson, Shaunn wrote:
> Running PostgreSQL 7.2.1 on RedHat Linux 7.2:
>
> I'm trying to do a "pg_dump -a -t t_table -d testdb > out.txt"
> and I'm still getting header information. How can I do
> a dump of data to a text file and not get information like
> the comments, Date for TOC Entry, Name, etc ... I just
> want the raw data. I've tried to pipe it through using
> tail, but I don't know if I'm missing the beginning of the
> file.
What about
pg_dump -a -t t_table -d testdb | grep -v "^--" > out.txt
? The grep will get rid of any line that begins with "-", which will
be a comment line.
A
On Tue, Oct 29, 2002 at 03:59:18PM -0500, Johnson, Shaunn wrote: > --but now ... am i not clear as to what the '-a' is suppose > --to provide? shouldn't there be a text file with > --just data or is this a bug of some sort? No, the "just data" doesn't have things like the create table statements. By default, those are in a dump. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.info> M2P 2A8 +1 416 646 3304 x110