Thread: Restoring roles information

Restoring roles information

From
JORGE MALDONADO
Date:
I am upgrading from PostgreSQL v9.0 to v9.1 and I have a plain format backup. I reviewed the backup file and I see that it contains everything except the creation of "login roles" and "group roles". 

Is there a way to include the creation of roles in a backup or do I have to create them manually before performing the restore operation?

Respectfully,
Jorge Maldonado

Re: Restoring roles information

From
Steve Crawford
Date:
On 03/27/2012 03:52 PM, JORGE MALDONADO wrote:
> I am upgrading from PostgreSQL v9.0 to v9.1 and I have a plain format
> backup. I reviewed the backup file and I see that it contains
> everything except the creation of "login roles" and "group roles".
>
> Is there a way to include the creation of roles in a backup or do I
> have to create them manually before performing the restore operation?
>
> Respectfully,
> Jorge Maldonado

How did you create the backup? The pg_dump program does not dump the
"globals", i.e. the roles, tablespaces, ...

The pg_dumpall program does dump globals but also dumps all databases
which may not be what you want.

You can use pg_dumpall with the -g (globals) option which will create a
dump having the only the commands needed to recreate the global entries.

Also, just as a check, did you create the dump file using the 9.1 dump
programs. If not, you should redo them. The recommended upgrade
procedure is to use the dump programs from the new version of PostgreSQL.

Cheers,
Steve


Re: Restoring roles information

From
JORGE MALDONADO
Date:


On Tue, Mar 27, 2012 at 5:55 PM, Steve Crawford <scrawford@pinpointresearch.com> wrote:
On 03/27/2012 04:21 PM, JORGE MALDONADO wrote:
Thanks for your reply. First of all, who should I reply to? To you or to pgsqlnovice group?
I have PostgreSQL v9.0 installed only, how do I use pg_dump from v9.1?
I am using pgAdmin to get the backup, is it better to use the pg_dump command?

Regards,
Jorge Maldonado


On Tue, Mar 27, 2012 at 5:04 PM, Steve Crawford <scrawford@pinpointresearch.com> wrote:
On 03/27/2012 03:52 PM, JORGE MALDONADO wrote:
I am upgrading from PostgreSQL v9.0 to v9.1 and I have a plain format backup. I reviewed the backup file and I see that it contains everything except the creation of "login roles" and "group roles".

Is there a way to include the creation of roles in a backup or do I have to create them manually before performing the restore operation?

Respectfully,
Jorge Maldonado

How did you create the backup? The pg_dump program does not dump the "globals", i.e. the roles, tablespaces, ...

The pg_dumpall program does dump globals but also dumps all databases which may not be what you want.

You can use pg_dumpall with the -g (globals) option which will create a dump having the only the commands needed to recreate the global entries.

Also, just as a check, did you create the dump file using the 9.1 dump programs. If not, you should redo them. The recommended upgrade procedure is to use the dump programs from the new version of PostgreSQL.

Cheers,
Steve


Hi Jorge,

Welcome to the groups. Most of the time people tend to reply-to-all so the group gets the email and the sender gets it directly. Alternately, you can just reply to the group. Just be sure the group is included - that way the group knows which messages have been answered and, since the messages are archived, it may provide the answers when someone does a future web-search.

Also, to "fit in", be sure to "bottom post". Most biz-types top-post so the most recent messages are on top. I think Outlook defaults that way. The tradition on this list, which people will point out with varying degrees of delicacy, is to add your reply to the bottom of the message.

I tend to use the command-line for maintenance so I'm not the best person to ask about the pgAdmin 9.0/9.1 issues. I'd go back to my prior reply and this time reply to the list with your questions. You might want to include the version of pgAdmin and a bit more detail including:

1. What version of pgAdmin are you running and what OS is it on?

2. What OS is the server running on?

3. Are both server and pgAdmin on the same machine?

Cheers,
Steve

1. Are pgAdmin and the PostgreSQL server on the same machine?

-----------------------------------------------------------------------------------------------------------
 
Hello Steve,

1. pgAdmin version 1.12.1
2. I am using Windows XP Pro as my development platform.
3. PostgreSQL server and pgAdmin are in the same machine.

Regards,
Jorge Maldonado

Re: Restoring roles information

From
JORGE MALDONADO
Date:


On Tue, Mar 27, 2012 at 5:55 PM, Steve Crawford <scrawford@pinpointresearch.com> wrote:
On 03/27/2012 04:21 PM, JORGE MALDONADO wrote:
Thanks for your reply. First of all, who should I reply to? To you or to pgsqlnovice group?
I have PostgreSQL v9.0 installed only, how do I use pg_dump from v9.1?
I am using pgAdmin to get the backup, is it better to use the pg_dump command?

Regards,
Jorge Maldonado


On Tue, Mar 27, 2012 at 5:04 PM, Steve Crawford <scrawford@pinpointresearch.com> wrote:
On 03/27/2012 03:52 PM, JORGE MALDONADO wrote:
I am upgrading from PostgreSQL v9.0 to v9.1 and I have a plain format backup. I reviewed the backup file and I see that it contains everything except the creation of "login roles" and "group roles".

Is there a way to include the creation of roles in a backup or do I have to create them manually before performing the restore operation?

Respectfully,
Jorge Maldonado

How did you create the backup? The pg_dump program does not dump the "globals", i.e. the roles, tablespaces, ...

The pg_dumpall program does dump globals but also dumps all databases which may not be what you want.

You can use pg_dumpall with the -g (globals) option which will create a dump having the only the commands needed to recreate the global entries.

Also, just as a check, did you create the dump file using the 9.1 dump programs. If not, you should redo them. The recommended upgrade procedure is to use the dump programs from the new version of PostgreSQL.

Cheers,
Steve


Hi Jorge,

Welcome to the groups. Most of the time people tend to reply-to-all so the group gets the email and the sender gets it directly. Alternately, you can just reply to the group. Just be sure the group is included - that way the group knows which messages have been answered and, since the messages are archived, it may provide the answers when someone does a future web-search.

Also, to "fit in", be sure to "bottom post". Most biz-types top-post so the most recent messages are on top. I think Outlook defaults that way. The tradition on this list, which people will point out with varying degrees of delicacy, is to add your reply to the bottom of the message.

I tend to use the command-line for maintenance so I'm not the best person to ask about the pgAdmin 9.0/9.1 issues. I'd go back to my prior reply and this time reply to the list with your questions. You might want to include the version of pgAdmin and a bit more detail including:

1. What version of pgAdmin are you running and what OS is it on?

2. What OS is the server running on?

3. Are both server and pgAdmin on the same machine?

Cheers,
Steve

1. Are pgAdmin and the PostgreSQL server on the same machine?