Re: Verbose output of pg_dump not show schema name - Mailing list pgsql-hackers

From Fabrízio de Royes Mello
Subject Re: Verbose output of pg_dump not show schema name
Date
Msg-id CAFcNs+qQiyQHSsSzrM0U9t+e5cAS8q98_P4nOYxGMOK1c=JH-w@mail.gmail.com
Whole thread Raw
In response to Re: Verbose output of pg_dump not show schema name  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Verbose output of pg_dump not show schema name
Re: Verbose output of pg_dump not show schema name
List pgsql-hackers

On Wed, Aug 20, 2014 at 2:43 AM, Michael Paquier <michael.paquier@gmail.com> wrote:
>
> I had a look at this patch, and here are a couple of comments:
> 1) Depending on how ArchiveEntry is called to register an object to
> dump, namespace may be NULL, but it is not the case
> namespace->dobj.name, so you could get the namespace name at the top
> of the function that have their verbose output improved with something
> like that:
> const char *namespace = tbinfo->dobj.namespace ?
>                tbinfo->dobj.namespace->dobj.name : NULL;
> And then simplify the message output as follows:
> if (namespace)
>    write_msg("blah \"%s\".\"%s\" blah", namespace, classname);
> else
>    write_msg("blah \"%s\" blah", classname);
> You can as well safely remove the checks on namespace->dobj.name.

Ok

> 2) I don't think that this is correct:
> -                                       ahlog(AH, 1, "processing data
> for table \"%s\"\n",
> -                                                 te->tag);
> +                                       ahlog(AH, 1, "processing data
> for table \"%s\".\"%s\"\n",
> +                                                 AH->currSchema, te->tag);
> There are some code paths where AH->currSchema is set to NULL, and I
> think that you should use te->namespace instead.

Yes, you are correct!


> 3) Changing only this message is not enough. The following verbose
> messages need to be changed too for consistency:
> - pg_dump: creating $tag $object
> - pg_dump: setting owner and privileges for [blah]
>
> I have been pondering as well about doing similar modifications to the
> error message paths, but it did not seem worth it as this patch is
> aimed only for the verbose output. Btw, I have basically fixed those
> issues while doing the review, and finished with the attached patch.
> Fabrizio, is this new version fine for you?
>

Is fine to me.

I just change "if (tbinfo->dobj.namespace != NULL)" to "if (tbinfo->dobj.namespace)".

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello
Attachment

pgsql-hackers by date:

Previous
From: Mayeul Kauffmann
Date:
Subject: Re: Patching for increasing the number of columns
Next
From: Andreas 'ads' Scherbaum
Date:
Subject: documentation update for doc/src/sgml/func.sgml