Re: Backup & Restore a database in PostgreSQL

From: Greg Williamson <gwilliamson39(at)yahoo(dot)com>
To: Siva Palanisamy <siva_p(at)hcl(dot)com>, John R Pierce <pierce(at)hogranch(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Backup & Restore a database in PostgreSQL
Date: 2011-08-08 10:02:20
Message-ID: 1312797740.51629.YahooMailNeo@web46112.mail.sp1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Siva --

>
> Thanks a lot for your reply. As usual Backup worked perfectly. When I tried restore using the command you provided, I got the below list of errors! Please help me > out on this.
>
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 14; 1255 16384 FUNCTION plpgsql_call_handler() postgres
> pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of function public.plpgsql_call_handler
>     Command was: DROP FUNCTION public.plpgsql_call_handler();

Clue #1 -- you are not running as the correct user for the restore into this database.

> pg_restore: [archiver (db)] Error from TOC entry 276; 2612 16387 PROCEDURAL LANGUAGE plpgsql
> pg_restore: [archiver (db)] could not execute query: ERROR:  must be superuser to drop procedural language
>     Command was: DROP PROCEDURAL LANGUAGE plpgsql;

Clue #2!

So you need to change to being the postgres user that created the database, which presumably has the proper permissions to drop these various entities.

<snipped redundant error messages?

HTH,

Greg Williamson

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Achilleas Mantzios 2011-08-08 10:31:16 Re: How to get to know the current user account is superuser or not?
Previous Message Simon Riggs 2011-08-08 09:56:06 Re: How to get to know the current user account is superuser or not?