Skip site navigation (1) Skip section navigation (2)

bug in pg_dump with GRANT/REVOKE

From: Robert Forsman <thoth(at)purplefrog(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: bug in pg_dump with GRANT/REVOKE
Date: 2001-06-01 17:06:27
Message-ID: 200106011706.NAA03628@nile.purplefrog.com (view raw or flat)
Thread:
Lists: pgsql-hackers
  I'm running postgres 6.5.3 and 7.0.3 and pg_dump gives me the following
output:

DROP TABLE "genrenametable";
CREATE TABLE "genrenametable" (
        "genreid" int4,
        "name" character varying(128),
        "parentgenre" int4,
        "enabled" bool DEFAULT 'f' NOT NULL
);
REVOKE ALL on "genrenametable" from PUBLIC;
GRANT SELECT on "genrenametable" to "hammor";
GRANT SELECT on "genrenametable" to "johnbr";
COPY "genrenametable" FROM stdin;
4115    80s Alt Hits    4096    t
4138    New Wave Hits   4096    t
4117    90s Alt Hits    4096    t
...

  As you can guess, this will not successfully restore the table.

  Perhaps the REVOKE/GRANT statements can be moved to after the COPY. 

  The fancy solution would be to make sure the table owner has
permissions to do the COPY, and then revoke the permissions afterward if
necessary.

Responses

pgsql-hackers by date

Next:From: Ian Lance TaylorDate: 2001-06-01 17:13:50
Subject: Re: Re: Support for %TYPE in CREATE FUNCTION
Previous:From: Ian Lance TaylorDate: 2001-06-01 16:59:07
Subject: Re: AW: [HACKERS] Re: Support for %TYPE in CREATE FUNCTION

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group