Thread: QT can not connect to postgresql

QT can not connect to postgresql

From
Ramon Orticio
Date:
i'm new to linux. i started the postgresql 7.3 server
in the root using red hat 9 and it says that
Postmaster already running. but when i used QT
Designer's database connection, in which i wrote
Driver: QPSQL7 database:bedrock, user: postgres, host:
localhost  a dialog box appears stating:  can not
connect to the database. please ensure that the
database is running and that all the connection
information is correct. [QPSQL: unable to connect
could not connect to server. connection refused. is
the server running on host localhost and accepting
TCP/IP connections on port 5432?

i tried to open the pg_hba.conf and postgresql.conf to
change the tcip from false to true still the problem
persists.


prior to this, when i used $ postmaster -D
/var/lib/pgsql/data, the following message is posted
FATAL: cannot open /var/lib/pgsql/data/PG_VERSION:
Permission denied.

sometime when i  type service postgresql start in the
root the following message is posted:
bash: service: command not found

itried to loggin as posgres user and used bash-2.05b$
service postgresql start the same  message is posted.
bash: service: command not found




i would appreciate any help on this matter.

thanks.

sincerely,

ramon



_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

Re: QT can not connect to postgresql

From
stig erikson
Date:
Ramon Orticio wrote:
> i'm new to linux. i started the postgresql 7.3 server
> in the root using red hat 9 and it says that
> Postmaster already running. but when i used QT
> Designer's database connection, in which i wrote
> Driver: QPSQL7 database:bedrock, user: postgres, host:
> localhost  a dialog box appears stating:  can not
> connect to the database. please ensure that the
> database is running and that all the connection
> information is correct. [QPSQL: unable to connect
> could not connect to server. connection refused. is
> the server running on host localhost and accepting
> TCP/IP connections on port 5432?
>
> i tried to open the pg_hba.conf and postgresql.conf to
> change the tcip from false to true still the problem
> persists.
>
>
> prior to this, when i used $ postmaster -D
> /var/lib/pgsql/data, the following message is posted
> FATAL: cannot open /var/lib/pgsql/data/PG_VERSION:
> Permission denied.
>
> sometime when i  type service postgresql start in the
> root the following message is posted:
> bash: service: command not found
>
> itried to loggin as posgres user and used bash-2.05b$
> service postgresql start the same  message is posted.
> bash: service: command not found
>
>
>
>
> i would appreciate any help on this matter.
>
> thanks.
>
> sincerely,
>
> ramon
>
>
>
> _______________________________
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>




to do "service postgresql start/stop/restart" you should be root, not
postgres.


try connecting to the server locally:
[root@]# su postgres
[postgres@]# pslq -d dbname

if you have no databases:
[postgres@]# createdb dbname
[postgres@]# psql -d dbname



if this works but you still have problems connecting over tcpip, look in
  the /var/lib/pgsql/data/postgresql.conf  file and enable tcpip
connections.