[postgis-users] postgis account setting

Adam Quiney aquiney at refractions.net
Tue Jan 10 08:17:27 PST 2006


Hi Kuo,

I run postgres mainly via Linux/Unix here, so this advice may or may not 
be pertinent - either way though, it's psql that is asking you to supply 
the correct username and password, rather than shp2pgsql.  If you do not 
explicitly state the username used to connect to the database, it will 
assume the username currently logged in and running the process - in 
this case Kuo.

You may need to just run "psql --help" to see what the switches are in 
Windows XP, but in Linux, I know you can explicitly provide the username 
like this:

psql -U postgres [DBNAME]

So, in your case, running shp2pgsql, you would need to use the following 
command:

shp2pgsql -D maryland_road.shp road maryland | psql -U postgres maryland

Incidentally, the reason that postgres is spitting out this error 
message is because you're running shp2pgsql in Dump mode - this means it 
just spits out a bunch of SQL commands, which you are then piping as 
input to the postgres command - psql.

Hope that helps,

--Adam

K Kuo wrote:

> Hi all,
> I got problems while running shp2pgsql with windows xp command prompt.
> My command is like: shp2pgsql -D maryland_road.shp road maryland | 
> psql maryland
> and got the message as: psql: FATAL: password authentication failed 
> for user "Kuo"
> "Kuo" is my account name for windows xp. I create maryland database 
> under user name "postgres" which was created by postgreSQL while 
> installation. However, it does not appear neither on xp login screen 
> nor user account in xp. I tried to create an account of " postgres" 
> which I can log in whith xp and probably avoid above problem but xp 
> told me that this account already exists. It seems that there is no 
> option for changing user name with shp2pgsql command. Is there a way 
> to run shp2pgsql under user name "Kuo"? or how to avoid account 
> restrict problem in the future?
>
> thanks,
>
> kuo
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>

-- 
Adam Quiney
Analyst
Refractions Research Inc.
(250) 383-3022




More information about the postgis-users mailing list