Re: Second message: "Problem generating database using pgAdmin III - PostgreSQL version is 9.1" - Mailing list pgadmin-support

From Dave Page
Subject Re: Second message: "Problem generating database using pgAdmin III - PostgreSQL version is 9.1"
Date
Msg-id CA+OCxowEE1h=d8UPy4p51VLQCVV29N-e8P-Hkz1DbKM+pJL41w@mail.gmail.com
Whole thread Raw
In response to Re: Second message: "Problem generating database using pgAdmin III - PostgreSQL version is 9.1"  ("Hager, Paul CIV NAVSEA Crane, NAVSEA" <paul.hager@navy.mil>)
List pgadmin-support
On Tue, Sep 10, 2013 at 8:28 PM, Hager, Paul CIV NAVSEA Crane, NAVSEA
<paul.hager@navy.mil> wrote:
> OK, I tried again.  Did:
> "c:\program files\postgresql\9.1\bin\psql" -h localhost -U postgres development-pgs < dsYYYYMMDD
>
> That actually worked - thanks.  However, it produced a large number of errors - things like "relation X already
exists". Also, no DB file called "development-pgs" was created, which I expected. 
>
> I decided to go back to the original recipe and logged in to pgAdmin.  Got a huge number of errors.  Decided to edit
filesas in original recipe.  This time just edited out the "\connect" and the "GRANT INSERT" commands in the schema
file. I actually think that was intended in the recipe though it was by no means clear.  Opened file in pgAdmin.  Then
Iexecuted as script.  Lots of errors this time.  Here's a representative one: 
> [WARNING] CREATE TABLE "whatever" (
>                 "whatever1" integer
>                 "whatever2" character varying(50) NOT NULL
>         )
> [ERROR] relation "whatever" already exists
> There are also manifold duplicate key errors.
>
> Now it may be that something has been loaded from a previous effort.  I went on ahead and loaded the large data file.
Vast numbers of errors including duplicate keys. 

Yes, it sounds like the database is already there. Drop it first
(assuming you don't need it), then recreate it so it's empty.

> I made an attempt to look at the database.  There seemed to be some tables but there were no connections.  Given all
theerrors I don't trust any of this.  I'm thinking I might blow everything away, recreate the database, and try again. 
>
> That brings up a second problem.  Where is this database located?  Assuming I have created something how do I save
it. The last time I did a "save" operation, it just saved a schema file. 

I have no idea where the database is located on your system - and a
database isn't just a file you can save anyway. You can use pg_dump to
export it to a data file, the same way as you did with your original
database.

> I need to have a discrete database somewhere outside of pgAdmin.  I assume this is a trivial matter but I couldn't
findhow to do it. 

None of the databases are "in" pgAdmin. pgAdmin is just a client tool
that connects to the database server, in the same way as pg_dump, psql
or your application will. Somewhere on your machine is a "data
directory", on Windows this is C:\Program Files\PostgreSQL\9.X\data by
default; this contains the actual databases, but they're just a bunch
of data files that you can't do anything with directly (and don't be
tempted to delete anything from the pg_xlog or pg_clog directories -
that will break the system).

> My attempts to invoke help tried to active IE.  I'm on a Secret machine and there is no internet connection so that
justgenerated an error. 

The Help Contents in pgAdmin should open a local file. There also
should be some Help options on the Start Menu under PostgreSQL for the
database server, which will be the same as the online docs.

Please note that I'm going to be largely unavailable for the next
couple of weeks or more due to travel. You're far more likely to get
help on the pgsql-general@postgresql.org mailing list than here, as
this really is off-topic for this list.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgadmin-support by date:

Previous
From: Dave Page
Date:
Subject: Re: RE: [pgadmin-support] will 1.18.0 be available for download from the www.pgadmin.org site?
Next
From: Dave Page
Date:
Subject: pgAdmin 1.18.0 Released