Thread: Newbe questions: Setting Passwords
Hi, I'm new to this list and Postgres. I have Postgres up and running, but I'm having trouble understanding the password system. In particular, I have the following troubles: 1. Is it correct that users can only be given permissions on a particular TABLE? 2. The owner of all my tables are listed as "postgres". Should I then be using this "postgres" as the user name when I'm connecting (I'll be connecting with PHP). 3. How can I change the password of "postgres"? Sorry for the base-ness of the above questions, but your input would save me a lot of grief. - anatole
Hi, You could use the following...;-) psql -U postgres template1 UPDATE pg_shadow SET passwd='whatever' WHERE usename='postgres'; You could also use GRANT or create other users as well... kindly check the administrative section of your documentation...;-) Cheers, John Clark
Hi, Thanks for your advice. I set my password as you advised below, however I'm still having some problems connecting. When I try to connect I get the following error message: Unable to connect to PostgreSQL server: FATAL 1: SetUserId: user 'password=' is not in 'pg_shadow' When connecting I'm using username "postgres" and the password that I used when I updated the pg_shadow file as suggested. Any ideas??? > Hi, > > > You could use the following...;-) > > > psql -U postgres template1 > > UPDATE pg_shadow SET passwd='whatever' WHERE usename='postgres'; >
Anatole Varin wrote: > > Hi, > Thanks for your advice. I set my password as you advised below, however I'm > still having some problems connecting. When I try to connect I get the > following error message: > > Unable to connect to PostgreSQL server: FATAL 1: SetUserId: user 'password=' > is not in 'pg_shadow' > > When connecting I'm using username "postgres" and the password that I used > when I updated the pg_shadow file as suggested. Any ideas??? > > > Hi, > > > > > > You could use the following...;-) > > > > > > psql -U postgres template1 > > > > UPDATE pg_shadow SET passwd='whatever' WHERE usename='postgres'; > > I don't believe I've had the pleasure of this problem before...;-) Would you mind showing us your exact command, that you tried to execute to get into your postgresql database? (Maybe a little cut and paste...;-)) Is your PostgreSQL database part of your server? Or at another server... And kindly check this file (I assuming youe got PostgreSQL 7.x) /var/lib/pgsql/data/postmaster.opts.default If you have a "-i" in this file. HTH, Cheers, John Clark
>> Unable to connect to PostgreSQL server: FATAL 1: SetUserId: user 'password=' >> is not in 'pg_shadow' Some kind of syntactic confusion at the client end, evidently: the software is taking "password=" as your username, which I'm pretty sure is not what you intended. regards, tom lane
how can I make a timestamp data type be outputted without the time zone? I expect: "YYYY-MM-DD HH:MM:SS" instead of postgresql output: "YYYY-MM-DD HH:MM:SS-timezone" I know I can do that by using some functions on the select query, but my idea is to get this result without altering the queries, like changing an enviroment variable or a setting in the configuration file or whatever like that, but NOT in the query. from what I've read so far, set DATETYLE won't help at all, it just changes the way the date and the timezone is printed, but it won't ouput a strict 'YYYY-MM-DD HH:MM:SS' can postgresql do this at all (once again, without using functions or altering the query) Thanks in advance, Alex