Re: Verbose output of pg_dump not show schema name

Поиск
Список
Период
Сортировка
От Fabrízio de Royes Mello
Тема Re: Verbose output of pg_dump not show schema name
Дата
Msg-id CAFcNs+qTaiyJf7YWoOZ6SLzUpwPgJfYB-28Ob7SZFAqimXwKkw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Verbose output of pg_dump not show schema name  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Verbose output of pg_dump not show schema name  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers

On Thu, Apr 17, 2014 at 11:36 AM, Bruce Momjian <bruce@momjian.us> wrote:
>
> On Thu, Apr 17, 2014 at 11:29:03AM -0300, Fabrízio de Royes Mello wrote:
> > > > This database have a lot of different schemas with same structure and if I
> > > > need do view the status of dump I don't know what schema the table are dump
> > > > from.
> > > Yes this may be helpful. The attached quick'n dirty patch implements it.
> > >
> >
> > Very nice... thanks!!!
> >
> > I add schema name do the following messages too:
> >
> > pg_restore: processing data for table "public"."bar"
> > pg_restore: processing data for table "public"."foo"
> > pg_restore: processing data for table "s1"."bar"
> > pg_restore: processing data for table "s1"."foo"
> > pg_restore: processing data for table "s2"."bar"
> > pg_restore: processing data for table "s2"."foo"
> > pg_restore: processing data for table "s3"."bar"
> > pg_restore: processing data for table "s3"."foo"
>
> Can you get that to _conditionally_ double-quote the strings? 

Sorry, I didn't understand what you means? Your idea is to check if the namespace is available and then don't show the double-quote, is that?


> In fact,
> maybe we don't even need the double-quotes.  How do we double-quote
> other places?
>

Checking that more deeply I found some other places that show the table name and all of them are double-quoted.

$ grep 'table \\\"%s' src/bin/pg_dump/*.c
src/bin/pg_dump/common.c:                    write_msg(NULL, "failed sanity check, parent OID %u of table \"%s\" (OID %u) not found\n",
src/bin/pg_dump/pg_backup_archiver.c:                    ahlog(AH, 1, "processing data for table \"%s\".\"%s\"\n",
src/bin/pg_dump/pg_backup_archiver.c:    ahlog(AH, 1, "table \"%s\" could not be created, will not restore its data\n",
src/bin/pg_dump/pg_backup_db.c:            warn_or_exit_horribly(AH, modulename, "COPY failed for table \"%s\": %s",
src/bin/pg_dump/pg_dump.c:        write_msg(NULL, "Dumping the contents of table \"%s\" failed: PQgetCopyData() failed.\n", classname);
src/bin/pg_dump/pg_dump.c:        write_msg(NULL, "Dumping the contents of table \"%s\" failed: PQgetResult() failed.\n", classname);
src/bin/pg_dump/pg_dump.c:            write_msg(NULL, "WARNING: owner of table \"%s\" appears to be invalid\n",
src/bin/pg_dump/pg_dump.c:            write_msg(NULL, "reading indexes for table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:            write_msg(NULL, "reading foreign key constraints for table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:            write_msg(NULL, "reading triggers for table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:                            exit_horribly(NULL, "query produced null referenced table name for foreign key trigger \"%s\" on table \"%s\" (OID of table: %u)\n",
src/bin/pg_dump/pg_dump.c:                write_msg(NULL, "finding the columns and types of table \"%s\".\"%s\"\n",
src/bin/pg_dump/pg_dump.c:                write_msg(NULL, "finding the columns and types of table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:                              "invalid column numbering in table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:                write_msg(NULL, "finding default expressions of table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:                                  "invalid adnum value %d for table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:                write_msg(NULL, "finding check constraints for table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:                write_msg(NULL, ngettext("expected %d check constraint on table \"%s\" but found %d\n",
src/bin/pg_dump/pg_dump.c:                                         "expected %d check constraints on table \"%s\" but found %d\n",
src/bin/pg_dump/pg_dump.c:    exit_horribly(NULL, "invalid column number %d for table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:                write_msg(NULL, "invalid argument string (%s) for trigger \"%s\" on table \"%s\"\n",
src/bin/pg_dump/pg_dump.c:        write_msg(NULL, "query to get rule \"%s\" for table \"%s\" failed: wrong number of rows returned\n",


Just the "dumping contents of table.." message isn't double-quoted:

$ grep 'table %s' src/bin/pg_dump/*.c
src/bin/pg_dump/pg_dump.c:            write_msg(NULL, "dumping contents of table %s\n",


So maybe we must double-quote of all string, i.e. "public.foo", including the missing bellow.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Clock sweep not caching enough B-Tree leaf pages?
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Clock sweep not caching enough B-Tree leaf pages?