sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
KG's Avatar

Initalizing PostgreSQL Database


Question posted by: KG (Guest) on November 11th, 2005 11:50 PM


I'm getting the following error message when I try to create a user or database
on postgresql 7.2.2 on Freebsd 4.7, I installed it from the ports directory but
I'm stumped when I got the following error message. When I do a
/usr/local/etc/rc.d/010.pgsql.sh start all I get is this:

freebsd# sh 010.pgsql.sh start
pgsqlfreebsd#



$ createdb test1
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
createdb: database creation failed


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

4 Answers Posted
Richard Huxton's Avatar
Guest - n/a Posts
#2: Re: Initalizing PostgreSQL Database

On Monday 15 September 2003 15:10, KG wrote:[color=blue]
> I'm getting the following error message when I try to create a user or
> database on postgresql 7.2.2 on Freebsd 4.7, I installed it from the ports
> directory but I'm stumped when I got the following error message. When I do[/color]

I don't know anything about the BSDs but 7.2.4 was the last of the 7.2 series
- upgrade if at all possible.
[color=blue]
> $ createdb test1
> psql: could not connect to server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> createdb: database creation failed[/color]

Does a "ps" show anything running (postmaster)? I'm guessing not, since it
can't find the socket.
Have you run "initdb"? You need to do this to initialise the system, create
required files etc. I don't know if your startup script does this for you.
Is the "postgres" or "pgsql" (or whatever) user setup, does it have permission
to access your target data/base directory?

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to Join Bytes!)

Tom Lane's Avatar
Guest - n/a Posts
#3: Re: Initalizing PostgreSQL Database

KG <lists@i2iwebsolutions.com> writes:[color=blue]
> I'm stumped when I got the following error message. When I do a
> /usr/local/etc/rc.d/010.pgsql.sh start all I get is this:
> freebsd# sh 010.pgsql.sh start
> pgsqlfreebsd#[/color]

There are a lot of shoddy start scripts running around :-(. Yours is
probably dumping the postmaster's stderr output to /dev/null, so
whatever error message it puts out about being unable to start is
just vanishing. Or, if you're lucky, stderr is being sent to a logfile
you can look at. I'd suggest modifying the script if necessary so that
you can see what the postmaster is complaining about.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to Join Bytes! so that your
message can get through to the mailing list cleanly

KG's Avatar
Guest - n/a Posts
#4: Re: Initalizing PostgreSQL Database

Quoting Richard Huxton <dev@archonet.com>:
[color=blue]
> On Monday 15 September 2003 15:10, KG wrote:[color=green]
> > I'm getting the following error message when I try to create a user or
> > database on postgresql 7.2.2 on Freebsd 4.7, I installed it from the ports
> > directory but I'm stumped when I got the following error message. When I[/color]
> do
>
> I don't know anything about the BSDs but 7.2.4 was the last of the 7.2 series
>
> - upgrade if at all possible.
>[color=green]
> > $ createdb test1
> > psql: could not connect to server: No such file or directory
> > Is the server running locally and accepting
> > connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> > createdb: database creation failed[/color]
>
> Does a "ps" show anything running (postmaster)? I'm guessing not, since it
> can't find the socket.
> Have you run "initdb"? You need to do this to initialise the system, create
> required files etc. I don't know if your startup script does this for you.
> Is the "postgres" or "pgsql" (or whatever) user setup, does it have
> permission
> to access your target data/base directory?
>
> --
> Richard Huxton
> Archonet Ltd[/color]


Thanks I figured it out. I went to the /usr/local/pgsql directory and ran
initdb. All is well now.

Kevin[color=blue]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to Join Bytes!)
>[/color]




---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to Join Bytes!)

Vivek Khera's Avatar
Guest - n/a Posts
#5: Re: Initalizing PostgreSQL Database

>>>>> "TL" == Tom Lane <tgl@sss.pgh.pa.us> writes:

TL> KG <lists@i2iwebsolutions.com> writes:[color=blue][color=green]
>> I'm stumped when I got the following error message. When I do a
>> /usr/local/etc/rc.d/010.pgsql.sh start all I get is this:
>> freebsd# sh 010.pgsql.sh start
>> pgsqlfreebsd#[/color][/color]

TL> There are a lot of shoddy start scripts running around :-(. Yours is
TL> probably dumping the postmaster's stderr output to /dev/null, so
TL> whatever error message it puts out about being unable to start is

The one in the FreeBSD port doesn't fall into that category... look in
/var/log/postgres.log or something similar to that name.

Looks like he never ran initdb...

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: Join Bytes! Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

 
Not the answer you were looking for? Post your question . . .
196,839 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,839 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors