Thread: I hava a problem in postgresql!
HI!
I am a tiro in the postgresql,I will use the PHP Function to connection postgresql.I use the
pg_connect("localhost","5432","","","webmaster")
The error message:
warning: Unable to connect to PostgresSQL server: FATAL 1: SetUserId: user 'nobody' is not in 'pg_shadow' in /home/e0001cq/html/memo_postgre/memo_insert.php3 on line 2
Can you help me to solve the problem?
May I use the right function or right syntax?
Thanks.
"ksp" wrote: >I am a tiro in the postgresql,I will use the PHP Function to connection pos= >tgresql.I use the=20 >pg_connect("localhost","5432","","","webmaster") > >The error message: >warning: Unable to connect to PostgresSQL server: FATAL 1: SetUserId: user = >'nobody' is not in 'pg_shadow' in /home/e0001cq/html/memo_postgre/memo_inse= >rt.php3 on line 2 PostgreSQL users are not the same as system users. You have to create the user `nobody' in PostgreSQL (or tell PHP to connect as a different user). As user postgres, do: `createuser nobody' at the shell prompt and answer the questions. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47 GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "O death, where is thy sting? O grave, where is thy victory?" 1 Corinthians 15:55
>>>>> "ksp" == ksp <ksp@ms12.url.com.tw> writes: ksp> I am a tiro in the postgresql,I will use the PHP Function to ksp> connection postgresql. I use the ksp> pg_connect ("localhost","5432","","","webmaster") ksp> The error message: ksp> warning: Unable to connect to PostgresSQL server: ksp> FATAL 1: SetUserId: user 'nobody' is not in 'pg_shadow' in ksp> /home/e0001cq/html/memo_postgre/memo_insert.php3 on line 2 You need to either (1) run createuser to add "nobody" to the pg_auth table, or (2) add signon information to your pg_connect command. If you are using PHP4, you can replace the above with pg_connect ("host=localhost port=5432 user=SOMEBODY password=PASSWD dbname=webmaster") where SOMEBODY and PASSWD are appropriate for your installation. If you are not using password authentication, just omit that parameter. roland -- PGP Key ID: 66 BC 3B CD Roland B. Roberts, PhD RL Enterprises roland@rlenter.com 76-15 113th Street, Apt 3B rbroberts@acm.org Forest Hills, NY 11375
> ksp> pg_connect ("localhost","5432","","","webmaster") > > ksp> The error message: > ksp> warning: Unable to connect to PostgresSQL server: > ksp> FATAL 1: SetUserId: user 'nobody' is not in 'pg_shadow' in > ksp> /home/e0001cq/html/memo_postgre/memo_insert.php3 on line 2 In addition to Roland's suggestion : You will have to grant access to nobody after you create it as a user like: grant ALL on <table_name> to nobody; type \h grant; in your pgsql monitor for the syntax Regards, Arup Bhanja - nibbles|inter@ctive Calcutta, INDIA. - nibbles@caltiger.com GRASP MixMedia Ad server demo: http://www.mystical-stuff.com/grasp/