PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesPostgreSQL Help
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Learn More!


Download to Enter
| Contest Rules

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 5th, 2012, 03:27 AM
derstauner derstauner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2010
Posts: 71 derstauner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 35 m 20 sec
Reputation Power: 3
Set server password

Hi,

how can I set the server password via console?

On a frish installed machine, if I open the server with pgadminIII, it asks me for a password.

But I want to set the password after installing with the run of a .bat file.

This .bat file will import 3 databases too.

But if the passwort for the server is not set, I can't import the databases.

Thanks.

Reply With Quote
  #2  
Old February 5th, 2012, 04:16 AM
shammat shammat is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Oct 2003
Location: Germany
Posts: 2,506 shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 5 Days 2 h 54 m 8 sec
Reputation Power: 283
I don't understand your question.

You supply the password for the super user when running initdb

So you already know the password (otherwise you could not have finished the installation)

Reply With Quote
  #3  
Old February 5th, 2012, 04:44 AM
derstauner derstauner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2010
Posts: 71 derstauner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 35 m 20 sec
Reputation Power: 3
I install postgresql with the windows installer.

I set the password for the postgres user during the installation (it asks me for one).

Is this the password for the superuser (postgres)?

A new database cluster is created too during the installation (the windows installer do this).

After that I open with pgadminIII the server and it asks me for a password and whether I want to store it or not. I give the password, what I gave during the installation and everything is fine.

But: how can I acces the server right after the installation? How can I pass this password in the console? Because I want to performe some psql commands after installation. And if I don't open the server with pgadminIII and set the password to acces to the server, the psql commands fail.

Reply With Quote
  #4  
Old February 5th, 2012, 05:24 AM
shammat shammat is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Oct 2003
Location: Germany
Posts: 2,506 shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 5 Days 2 h 54 m 8 sec
Reputation Power: 283
See the manual:

http://www.postgresql.org/docs/current/static/libpq-envars.html
http://www.postgresql.org/docs/current/static/libpq-pgpass.html

Reply With Quote
  #5  
Old February 5th, 2012, 10:10 AM
derstauner derstauner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2010
Posts: 71 derstauner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 35 m 20 sec
Reputation Power: 3
I think, the problem is the following:

- when I install postgresql, I install it under a given windows user account
- at the first time I want to connect to the server (under this user), the server wants the specified password, because the actuell account isn't the postgres manager account
- but if I log in windows with the postgres account, it won't ask me for a password to connect to the server

EDIT: I deleted the pgpass.conf and now, the server asks for a password (just as expected)

now, the question is, how can I pass the password in the console?

this doesn't work:

psql -U postgres -w password -f test.sql

this doesn't too

psql -U postgres -w 'password' -f test.sql

Last edited by derstauner : February 5th, 2012 at 10:40 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Set server password


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap