Where are the postgresql databases?

casey

Well-Known Member
Jan 17, 2003
2,291
0
191
MySQL databases are in /var/lib/mysql , but I can't seem to find the postgres databases. Anyone know where they are?

Also, do they get transfered over when you move an account from one server to another?

cPanel.net Support Ticket Number:
 

perlchild

Well-Known Member
Sep 1, 2002
279
0
166
Originally posted by casey
MySQL databases are in /var/lib/mysql , but I can't seem to find the postgres databases. Anyone know where they are?

Also, do they get transfered over when you move an account from one server to another?

cPanel.net Support Ticket Number:
/var/lib/pgsql is the canonical place, but postgres databases can only be copied through a dump, never by copying the files. I doubt the pkgacct features include pg_dump yet, they might in a later release however(I saw no signs of it on my server though).

cPanel.net Support Ticket Number:
 

casey

Well-Known Member
Jan 17, 2003
2,291
0
191
Re: Re: Where are the postgresql databases?

Originally posted by perlchild
/var/lib/pgsql is the canonical place, but postgres databases can only be copied through a dump, never by copying the files. I doubt the pkgacct features include pg_dump yet, they might in a later release however(I saw no signs of it on my server though).

cPanel.net Support Ticket Number:
I see. Thanks for the info. Can I use pg_dump to copy pgsql databases from one server to another? Will the permissions be okay? If so, how can I do this? If at all possible I'd rather not make my customers reconstruct their databases...

cPanel.net Support Ticket Number:
 

perlchild

Well-Known Member
Sep 1, 2002
279
0
166
Re: Re: Re: Where are the postgresql databases?

Originally posted by casey
I see. Thanks for the info. Can I use pg_dump to copy pgsql databases from one server to another? Will the permissions be okay? If so, how can I do this? If at all possible I'd rather not make my customers reconstruct their databases...

cPanel.net Support Ticket Number:
That is what that script is for. I do believe permissions are included in a pg_dump unlike mysql's method for conserving permissions.

cPanel.net Support Ticket Number:
 

casey

Well-Known Member
Jan 17, 2003
2,291
0
191
Re: Re: Re: Re: Where are the postgresql databases?

Originally posted by perlchild
That is what that script is for. I do believe permissions are included in a pg_dump unlike mysql's method for conserving permissions.

cPanel.net Support Ticket Number:
Thanks. I'll look into it.

cPanel.net Support Ticket Number:
 

casey

Well-Known Member
Jan 17, 2003
2,291
0
191
Re: Re: Re: Re: Re: Where are the postgresql databases?

I just looked briefly at the postgres manual, and it appears that pg_dumpall is better...?

cPanel.net Support Ticket Number:
 

perlchild

Well-Known Member
Sep 1, 2002
279
0
166
Re: Re: Re: Re: Re: Re: Where are the postgresql databases?

Originally posted by casey
I just looked briefly at the postgres manual, and it appears that pg_dumpall is better...?

cPanel.net Support Ticket Number:
pg_dumpall is a leaner, more specialized machine, it dumps all the databases, which may or may not be what you want, and has to be run as the postgres user

cPanel.net Support Ticket Number:
 

ricardom

Active Member
Mar 10, 2004
31
0
156
pgdump_all error

Hello,

Im trying to dump all the postgres database from the server, but im getting this error:

pg_dumpall: could not connect to database template1: FATAL: Password authentication failed for user "root

I tried to change the postgres password in WHM, but the results are the same, anyone know how to deal with that?

Thanks.
 

casey

Well-Known Member
Jan 17, 2003
2,291
0
191
ricardom said:
Hello,

Im trying to dump all the postgres database from the server, but im getting this error:

pg_dumpall: could not connect to database template1: FATAL: Password authentication failed for user "root

I tried to change the postgres password in WHM, but the results are the same, anyone know how to deal with that?

Thanks.
su to the postgres user first:

su - postgres
 

ttremain

Well-Known Member
Feb 16, 2003
246
2
168
cPanel Access Level
Root Administrator
Now how do I restore this pg_dumpall file ?

I tried using pg_restore but I get the message:
pg_restore: [archiver] input file does not appear to be a valid archive