[postgis-users] How to disable password in postgreSQL (pardon the stupid question)

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Mon Jan 12 01:31:39 PST 2009


kreshna_iceheart at yahoo.com wrote:

> I'm using postgreSQL 8.2.5 for Windows (with postGIS) and MapServer for Windows for development environment. They run on Windows XP.
> 
> I just reformatted the hard drive and re-installed everything (postGIS, ms4w), etc. Then, my first step is reloading all the development shapefiles (SHP) into postGIS database using shp2pgsql.exe (to create the script) and psql.exe (to run the script and load the data).
> 
> The psql.exe command doesn't specify password, and it is something like this:
> psql.exe -c -d mydatabase -h localhost -U myuser -f "D:\mapfiles\scripts\myloadingscript.sql"
> 
> When I ran the command above, it prompts me for a password. No wonder, because the script doesn't specify the password.
> 
> However, the script above did NOT prompt for a password before I reformatted my hard drive. Thus, I have disabled postgreSQL password in my previous setting.
> 
> Alas, I don't remember what should I do to disable password. I have given public access to my spatial database, and the psql.exe still prompts for a password.
> 
> I really don't remember what I did previously to my postgreSQL (before reformatting). I can only remember that the data loading script above never asked for password before I reformatted my hard drive.
> 
> Anyone could please help? Many thanks,
> -Kresh


Hi Kresh,

Search the PostgreSQL libpq documentation/Google for "pgpass". You can 
use this file to store passwords when connecting from certain clients to 
certain databases.


HTH,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063



More information about the postgis-users mailing list