Re: Extracting \ Generate DDL for existing object permissions

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: rod(at)iol(dot)ie
Cc: smiley2211 <msramsey22(at)gmail(dot)com>, 'PostgreSQL' <pgsql-general(at)postgresql(dot)org>
Subject: Re: Extracting \ Generate DDL for existing object permissions
Date: 2008-05-23 04:43:11
Message-ID: 48364B5F.5060404@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Raymond O'Donnell wrote:
> On 22/05/2008 22:33, smiley2211 wrote:
>
>> 1) dump database A - 2) Extract permissions from database B - (HOW????)
>
> How about dumping B using the plain-text format, then running the output
> through grep, looking for lines starting with "GRANT..."?

Hint: sometimes easier is to run pg_dump -fc and then pg_restore -l to
create an object list and operate your filters on this list, then use
the resulting list with pg_restore -L

With GRANTS, which are one-liners, it works either way. But the general
approach works very well with any statement, think of multiline create
table, create function ...

Cheers
Tino

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sushant Sinha 2008-05-23 05:10:27 Re: Fragments in tsearch2 headline
Previous Message Gurjeet Singh 2008-05-23 01:38:30 Re: Is this correct usage of generate_series?