Обсуждение: 6.5.1 pg_dump adds "connect as" line

Поиск
Список
Период
Сортировка

6.5.1 pg_dump adds "connect as" line

От
Ted Nolan SRI Augusta GA
Дата:
Folks,

Just noticed this:  I did a pg_dump on a database I wanted to send to
someone (from 6.5.1 on NT), and the dump file included a "connect as"
line.

This was bad, because we don't share a user namespace, and when he did

    psql < dumpfile

it died because my user did not exist on his machine.  (We used sed to
edit it out and continue from there..)

6.5 on Solaris does not emit this line, and reloads on machines with
different users work fine..

Is this a bug, or a feature I don't understand?


                Thanks,

                Ted

Re: [GENERAL] 6.5.1 pg_dump adds "connect as" line

От
"Ross J. Reedstrom"
Дата:
On Fri, Aug 27, 1999 at 10:34:58PM -0400, Ted Nolan SRI Augusta GA wrote:
> Folks,
>
> Just noticed this:  I did a pg_dump on a database I wanted to send to
> someone (from 6.5.1 on NT), and the dump file included a "connect as"
> line.
>
> This was bad, because we don't share a user namespace, and when he did
>
>     psql < dumpfile
>
> it died because my user did not exist on his machine.  (We used sed to
> edit it out and continue from there..)
>
> 6.5 on Solaris does not emit this line, and reloads on machines with
> different users work fine..
>
> Is this a bug, or a feature I don't understand?

New, poorly documented default of an old feature. It's always been
recommended that when using pg_dump for backup, the -z switch be used,
to dump ACLs (Access Control Lists) As of 6.5.1, this has been made the
default behavior. I call it poorly documented only because this bit me
as well recently, for the same reason, and the switch added to turn ACL
dumping off ( -x ) is not documented in the usage message. I went and
grovelled in the source to find it. Patch below:


--- pg_dump.c~  Mon Jul 26 10:43:34 1999
+++ pg_dump.c   Fri Aug 27 23:59:41 1999
@@ -160,7 +160,9 @@
        fprintf(stderr,
                        "\t -v          \t\t verbose\n");
        fprintf(stderr,
-                       "\t -z          \t\t dump ACLs (grant/revoke)\n");
+                       "\t -z          \t\t dump ACLs (grant/revoke) on by default\n");
+       fprintf(stderr,
+                       "\t -x          \t\t don't dump ACLs\n");
        fprintf(stderr,
                        "\nIf dbname is not supplied, then the DATABASE environment "
                        "variable value is used.\n");


--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

Re: [GENERAL] 6.5.1 pg_dump adds "connect as" line

От
Bruce Momjian
Дата:
> New, poorly documented default of an old feature. It's always been
> recommended that when using pg_dump for backup, the -z switch be used,
> to dump ACLs (Access Control Lists) As of 6.5.1, this has been made the
> default behavior. I call it poorly documented only because this bit me
> as well recently, for the same reason, and the switch added to turn ACL
> dumping off ( -x ) is not documented in the usage message. I went and
> grovelled in the source to find it. Patch below:
>

Shame on me.

I forgot to put -x in the pg_dump options display.  I did get it into
the manual pages, though.

Fixed now.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026