From: | "Erik Rijkers" <er(at)xs4all(dot)nl> |
---|---|
To: | "Ian Lawrence Barwick" <barwick(at)gmail(dot)com> |
Cc: | "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_restore: show object schema name in verbose output |
Date: | 2013-08-04 07:17:24 |
Message-ID: | 9bb227df86012761cc96ce412fe2eec2.squirrel@webmail.xs4all.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, August 4, 2013 04:51, Ian Lawrence Barwick wrote:
> I just noticed that pg_restore executing in "verbose" mode displays the
> name of the object being restored, but not its schema.
>
Good idea. We have many schemata with tables of the same name and
reporting the schema name certainly improves the readability and error
trackdown during restore.
I notice 2 things:
1. pg_restore now outputs reports about COMMENT like this:
pg_restore: creating COMMENT restore_verbose_test.TABLE t
pg_restore: creating COMMENT restore_verbose_test.COLUMN t.c
pg_restore: creating COMMENT restore_verbose_test.COLUMN t.i
I assume the .TABLE and .COLUMN here is a bug; it should just be:
pg_restore: creating COMMENT restore_verbose_test t
as it used to be.
2. Several of the lines that are output by pg_restore now mention
the schema, but not the "processing" line:
pg_restore: processing data for table "t"
Could it be added there too?
Thanks,
Erik Rijkers
#!/bin/sh
schema=restore_verbose_test
table=t
t=$schema.$table
rm -rf $schema.dump
echo
echo "
drop schema if exists $schema cascade;
create schema $schema;
drop table if exists $t;
create table $t(c text, i serial primary key);
comment on table $t is 'table $t is a table';
comment on column $t.c is 'column c is a column text in table $t';
comment on column $t.i is 'column i is a column serial (pk) in table $t';
insert into $t select chr(i) from generate_series(65,70) f(i);
" | psql -X
echo "table $t limit 5; \\d+ $t" | psql -X
time pg_dump -v -F d -n $schema -f $schema.dump testdb
echo "drop schema if exists $schema cascade;" | psql -X
echo '\dn '$schema | psql -X
pg_restore -v -d testdb $schema.dump
echo '\dn '$schema | psql -X
echo "table $t limit 5; \\d+ $t" | psql -X
From | Date | Subject | |
---|---|---|---|
Next Message | Ian Lawrence Barwick | 2013-08-04 09:12:42 | Re: pg_restore: show object schema name in verbose output |
Previous Message | Ian Lawrence Barwick | 2013-08-04 02:51:41 | pg_restore: show object schema name in verbose output |