Unix Technical Forum

Regarding Postgres access through C

This is a discussion on Regarding Postgres access through C within the pgsql Novice forums, part of the PostgreSQL category; --> Dear all While trying to connect to postgressql through C program iam getting the following error ..... Connection to ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 10:37 PM
Krishnaprasad
 
Posts: n/a
Default Regarding Postgres access through C

Dear all

While trying to connect to postgressql through C program iam
getting the following error .....

Connection to database failed.
FATAL: user "root" does not exist

How can I connect to the database as user 'postgres' through C .

Rgds
krishna


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 10:37 PM
A. Kretschmer
 
Posts: n/a
Default Re: Regarding Postgres access through C

am 23.02.2006, um 15:31:22 +0530 mailte Krishnaprasad folgendes:
> Dear all
>
> While trying to connect to postgressql through C program iam getting
> the following error .....
> Connection to database failed.
> FATAL: user "root" does not exist
>
> How can I connect to the database as user 'postgres' through C .



Read:
http://www.postgresql.org/docs/8.1/i...g-connect.html

You can find there a example.


HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47215, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 10:37 PM
Naz Gassiep
 
Posts: n/a
Default Re: Regarding Postgres access through C

you have to connect to the database using the operating system's
database user. This is usually "postgres" in most default installs. if
your program is running as root, it will need to specify the user it
wants to use when connecting to the db.

- MrNaz.


Krishnaprasad wrote:
> Dear all
>
> While trying to connect to postgressql through C program iam
> getting the following error .....
> Connection to database failed.
> FATAL: user "root" does not exist
>
> How can I connect to the database as user 'postgres' through C .
>
> Rgds
> krishna
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>


--
--------------------------------------------------------------
MrNaz photo gallery and journal at:
www.mrnaz.com

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:24 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com