Thread: Re: postgres not allowing new database?

Re: postgres not allowing new database?

From
"Len Morgan"
Date:
-----Original Message-----
From: lee johnson <lee@imyourhandiman.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Date: Wednesday, September 06, 2000 8:52 AM
Subject: [GENERAL] postgres not allowing new database?


>hi ..
>new user to postgresql access..
>
>upon trying to create new database getting error as below:
>
>
>tcl error executing pg_exec
>create database handiman
>is not a valid postgresql
>connection

You don't have a connection to the database yet (like the message says).
You must first do a pg_connect and use the returned handle in the pg_exec
call:

% set c [pg_connect template1]
pg_exec $c "create database handiman"
pg_disconnect $c

set c [pg_connect handiman]
pg_exec $c "Whatever query you want to do on the handiman DB"

Hope this helps.

>
>well first off i'm not on network is that reason for error..
>i haven't done much reading yet but just in case i wanted to post this for
>time sake
>
>if this error is mentioned in readme somewhere either in docs or website
>i'll find it and just ignore this
>otherwise any help appreciated......
>
>lee
>----------------
>
>
>
>


Compilator Postgres

From
Ricardo Timaran
Date:
Where can I find documentation about the compilator of Postgres?

Ricardo Timaran Pereira
Universidad del Valle
Colombia
ritimar@borabora.univalle.edu.co


Re: postgres not allowing new database?

From
lee johnson
Date:
"Trewern, Ben" wrote:

   You need to create a database first and connect to it.

   Best to do

   createdb testdb

   at the command line


below is error i get when trying to do above command
i realize i need to start postmaster but all trys not successful
as from docs i can't tell how to get my template1 created
( in /usr/local/data......... )
as that is required apparantly for postmaster..........
--------------------------------------------
[handiman@localhost /root]$ createdb handiman
psql: connectDBStart() -- connect() failed: Connection refused
        Is the postmaster running at 'localhost'
        and accepting connections on Unix socket '5432'?
createdb: database creation failed



Re: postgres not allowing new database?

From
lee johnson
Date:
> >upon trying to create new database getting error as below:
>
> >tcl error executing pg_exec
> >create database handiman
> >is not a valid postgresql
> >connection
>
> You don't have a connection to the database yet (like the message says).
> You must first do a pg_connect and use the returned handle in the pg_exec
> call:
>
> % set c [pg_connect template1]
> pg_exec $c "create database handiman"
> pg_disconnect $c
>
> set c [pg_connect handiman]
> pg_exec $c "Whatever query you want to do on the handiman DB"

not sure i completely understood ( i am new to postgres AND this kind of
software...........) and end user to boot........not on network just local...
I can find NO documentation of how to get postermaster going for
newbies............

i can only get above commands to work ( which was likely the orig. posters
intent ) if I
type in  set c in front of them all.........I did NOT try the last line
Pg_exec as i just started pgaccess after
set c pg_connect handiman

that line produced no errors so i thought i was ready to go.....
but once inside pgaccess i was unable to connect to handiman database........
i was gettting unable to connect to localhost/is postmaster running with -i
and accepint connections on tcp/ip at 5432 .........????

thanks for any help
lee


getting


Re: postgres not allowing new database?

From
lee johnson
Date:
well i'm in :-) whew!!!!!!
likely i missed reading howto somewhere in docs dunno regarldess i got in via:



from console:

su postgres
postmaster -i -D /usr/local/data ( i was getting can't connect tcp/ip error
before so i put in the -i trigger as suggested )

then I started pgaccess [database name]
then username/password and whala..

kewl now i can get down and dirty with the business at hand.....:)

lee
-----------------