Re: Backup Schema w/ SQL Text File

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: <operationsengineer1(at)yahoo(dot)com>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Backup Schema w/ SQL Text File
Date: 2006-05-08 10:40:11
Message-ID: C084984B.B1A4%sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 5/7/06 9:59 PM, "operationsengineer1(at)yahoo(dot)com"
<operationsengineer1(at)yahoo(dot)com> wrote:

> i backed up a db with sql text. no problems.
>
> however, i can't restore sql text using pgadmin3. so
> i go to the commandline and type in...
>
> psql depot_development < create.sql.

Besides the pg_restore functionality to access specific schemas, etc., you
could add tp the beginning of create.sql:

-- Next line assumes no depot_development exists....
create schema depot_development;
set search_path to depot_development, public;

See the documentation for search_path details, but it basically says "unless
I tell you otherwise, use depot_development as the default schema."

Sean

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Chansup Byun 2006-05-08 13:20:44 Re: looking for some suggestions
Previous Message Alan Hodgson 2006-05-08 04:05:20 Re: Backup Schema w/ SQL Text File