hi,for help!

Started by zhenyang guoalmost 16 years ago9 messagesgeneral
Jump to latest
#1zhenyang guo
concer.guo@gmail.com

hi, i have a problem not knowing how to fix . the follwing are error
information:

"
guo@guo-desktop:~$ su
Password:
root@guo-desktop:/home/guo# su - postgres
postgres@guo-desktop:~$ psql
psql: FATAL: database "postgres" does not exist
postgres@guo-desktop:~$ createdb test
createdb: could not connect to database postgres: FATAL: database
"postgres" does not exist

"
i thought it was due to postgresql ,so i reinstall it ,still not work.
i search the problem from the internet, but don't get it .
need your help. thank you!

#2Andreas Kretschmer
akretschmer@spamfence.net
In reply to: zhenyang guo (#1)
Re: hi,for help!

zhenyang guo <concer.guo@gmail.com> wrote:

hi, i have a problem not knowing how to fix . the follwing are error
information:

"
guo@guo-desktop:~$ su
Password:
root@guo-desktop:/home/guo# su - postgres
postgres@guo-desktop:~$ psql
psql: FATAL: database "postgres" does not exist
postgres@guo-desktop:~$ createdb test
createdb: could not connect to database postgres: FATAL: database "postgres"
does not exist

Which version?

Well, try:

createdb -T template0 test

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082�, E 13.56889�

#3Daniel Bausch
DanielBausch@gmx.de
In reply to: zhenyang guo (#1)
Re: hi,for help!

You need to "initdb" first.

Am Freitag, 28. Mai 2010 15:41:38 schrieb zhenyang guo:

Show quoted text

hi, i have a problem not knowing how to fix . the follwing are error
information:

"
guo@guo-desktop:~$ su
Password:
root@guo-desktop:/home/guo# su - postgres
postgres@guo-desktop:~$ psql
psql: FATAL: database "postgres" does not exist
postgres@guo-desktop:~$ createdb test
createdb: could not connect to database postgres: FATAL: database
"postgres" does not exist

"
i thought it was due to postgresql ,so i reinstall it ,still not work.
i search the problem from the internet, but don't get it .
need your help. thank you!

#4Ashesh Vashi
ashesh.vashi@enterprisedb.com
In reply to: zhenyang guo (#1)
Re: [GENERAL] hi,for help!

What is the output of the following commands?
psql -l
psql --version

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Postgres Company<http://www.enterprisedb.com&gt;

On Fri, May 28, 2010 at 7:11 PM, zhenyang guo <concer.guo@gmail.com> wrote:

Show quoted text

hi, i have a problem not knowing how to fix . the follwing are error
information:

"
guo@guo-desktop:~$ su
Password:
root@guo-desktop:/home/guo# su - postgres
postgres@guo-desktop:~$ psql
psql: FATAL: database "postgres" does not exist
postgres@guo-desktop:~$ createdb test
createdb: could not connect to database postgres: FATAL: database
"postgres" does not exist

"
i thought it was due to postgresql ,so i reinstall it ,still not work.
i search the problem from the internet, but don't get it .
need your help. thank you!

#5Ashesh Vashi
ashesh.vashi@enterprisedb.com
In reply to: zhenyang guo (#1)
Re: [GENERAL] hi,for help!

[Adding pgsql-general...]
Please CC to pgsql-general..
(Use reply-all...)

On Sat, May 29, 2010 at 2:31 PM, zhenyang guo <concer.guo@gmail.com> wrote:

hi,Ashesh, i did as you said ,it still gives problem. information from the
terminal is following:

" postgres@guo-desktop:~$ psql -l

psql: FATAL: database "postgres" does not exist

What is the output of this command:
psql -l template1

postgres@guo-desktop:~$ psql --version
psql (PostgreSQL) 8.4.4
contains support for command-line editing
postgres@guo-desktop:~$

"
it's kind of contradictory.and also in the phppgadmin interface i can't
find the postgres either.

That's strange.

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Postgres Company<http://www.enterprisedb.com&gt;

#6zhenyang guo
concer.guo@gmail.com
In reply to: Ashesh Vashi (#5)
Re: [GENERAL] hi,for help!

hi ,i got a problem , kinda don't know how to deal with it ,hoping can get
help here ,thanks !
also to Ashesh ,firstly, thanks for every favor you did. and the postgres
must exist ,maybe just present itself for some reason. when i give the
command "
psql -l template1 "

it was there.
<<<
List of databases
Name | Owner | Encoding | Collation | Ctype | Access
privileges
-----------+----------+----------+-------------+-------------+-----------------------
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
:
postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
:
postgres=CTc/postgres
test | guo1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/guo1
: guo1=CTc/guo1
test1 | guo1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/guo1
: guo1=CTc/guo1
:
test1=CTc/guo1
(4 rows)

2010/5/29 Ashesh Vashi <ashesh.vashi@enterprisedb.com>

Show quoted text

[Adding pgsql-general...]
Please CC to pgsql-general..
(Use reply-all...)

On Sat, May 29, 2010 at 2:31 PM, zhenyang guo <concer.guo@gmail.com>wrote:

hi,Ashesh, i did as you said ,it still gives problem. information from
the terminal is following:

" postgres@guo-desktop:~$ psql -l

psql: FATAL: database "postgres" does not exist

What is the output of this command:
psql -l template1

postgres@guo-desktop:~$ psql --version
psql (PostgreSQL) 8.4.4
contains support for command-line editing
postgres@guo-desktop:~$

"
it's kind of contradictory.and also in the phppgadmin interface i can't
find the postgres either.

That's strange.

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Postgres Company<http://www.enterprisedb.com&gt;

#7Ashesh Vashi
ashesh.vashi@enterprisedb.com
In reply to: zhenyang guo (#6)
Re: [GENERAL] hi,for help!

Hi,

Looks like, you accidentally deleted the postgresql database.
It can work without the postgres database, you just need to specify the
database name to work with.
i.e. psql test1

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Postgres Company<http://www.enterprisedb.com&gt;
On Sun, May 30, 2010 at 6:05 AM, zhenyang guo <concer.guo@gmail.com> wrote:

Show quoted text

hi ,i got a problem , kinda don't know how to deal with it ,hoping can get
help here ,thanks !
also to Ashesh ,firstly, thanks for every favor you did. and the
postgres must exist ,maybe just present itself for some reason. when i give
the command "
psql -l template1 "

it was there.
<<<
List of databases
Name | Owner | Encoding | Collation | Ctype | Access
privileges

-----------+----------+----------+-------------+-------------+-----------------------
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
:
postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
:
postgres=CTc/postgres
test | guo1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/guo1
:
guo1=CTc/guo1
test1 | guo1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/guo1
:
guo1=CTc/guo1
:
test1=CTc/guo1
(4 rows)

2010/5/29 Ashesh Vashi <ashesh.vashi@enterprisedb.com>

[Adding pgsql-general...]

Please CC to pgsql-general..
(Use reply-all...)

On Sat, May 29, 2010 at 2:31 PM, zhenyang guo <concer.guo@gmail.com>wrote:

hi,Ashesh, i did as you said ,it still gives problem. information from
the terminal is following:

" postgres@guo-desktop:~$ psql -l

psql: FATAL: database "postgres" does not exist

What is the output of this command:
psql -l template1

postgres@guo-desktop:~$ psql --version
psql (PostgreSQL) 8.4.4
contains support for command-line editing
postgres@guo-desktop:~$

"
it's kind of contradictory.and also in the phppgadmin interface i
can't find the postgres either.

That's strange.

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Postgres Company<http://www.enterprisedb.com&gt;

#8Scott Marlowe
scott.marlowe@gmail.com
In reply to: zhenyang guo (#6)
Re: [GENERAL] Re: [GENERAL] hi,for help!

On Sat, May 29, 2010 at 6:35 PM, zhenyang guo <concer.guo@gmail.com> wrote:

hi ,i got a problem , kinda don't know how to deal with it ,hoping can get
help here ,thanks !
 also to Ashesh  ,firstly, thanks for every favor you did. and  the postgres
must exist ,maybe just present itself for some reason. when i give the
command "
psql -l template1  "

 it was there.
<<<
         List of databases
   Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access
privileges
-----------+----------+----------+-------------+-------------+-----------------------
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             :
postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                             :
postgres=CTc/postgres
 test      | guo1     | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/guo1
                                                             : guo1=CTc/guo1
 test1     | guo1     | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/guo1
                                                             : guo1=CTc/guo1
                                                             :
test1=CTc/guo1
(4 rows)

I think you're confusing the owner with the dbname. there's not
postgres db. you can create one:

psql template1
create database postgres;

#9zhenyang guo
concer.guo@gmail.com
In reply to: Scott Marlowe (#8)
Re: [GENERAL] Re: [GENERAL] hi,for help!

hi ,it turn out i indeed deleted the postgres , and with the command
"psql template1
create database postgres; " i got my postgres.
Scott , Ashesh ,thanks for your both help .

2010/5/30 Scott Marlowe <scott.marlowe@gmail.com>

Show quoted text

On Sat, May 29, 2010 at 6:35 PM, zhenyang guo <concer.guo@gmail.com>
wrote:

hi ,i got a problem , kinda don't know how to deal with it ,hoping can

get

help here ,thanks !
also to Ashesh ,firstly, thanks for every favor you did. and the

postgres

must exist ,maybe just present itself for some reason. when i give the
command "
psql -l template1 "

it was there.
<<<
List of databases
Name | Owner | Encoding | Collation | Ctype | Access
privileges

-----------+----------+----------+-------------+-------------+-----------------------

template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |

=c/postgres

:
postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |

=c/postgres

:
postgres=CTc/postgres
test | guo1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/guo1
:

guo1=CTc/guo1

test1 | guo1 | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/guo1
:

guo1=CTc/guo1

:
test1=CTc/guo1
(4 rows)

I think you're confusing the owner with the dbname. there's not
postgres db. you can create one:

psql template1
create database postgres;