Thread: Ugh...createlang won't prompt for password

Ugh...createlang won't prompt for password

From
"Steve - DND"
Date:
Just when everything looked good, it went to crap again. I was able to
successfully install pltclu into one database with the command
"createlang -U postgres pltclu dbname". Upon hitting enter, I was prompted
for a password. The next time I went to run the same command, just on a
different DB, I am no longer prompted for a password, and receive the error
message, "createlang: could not connect to database template1: FATAL:
password authentication failed for user "postgres". I checked to see if this
error was specific to template1, by trying to install a different language
on the original DB. That too failed with the same error.

I have tried adding the -W, and --password options, as well as both of them
together. Whatever I do though, I cannot get createlang to prompt me for a
password.

What do I need to do to figure out this problem?

Thanks,
Steve



Re: Ugh...createlang won't prompt for password

From
"Magnus Hagander"
Date:
> Just when everything looked good, it went to crap again. I was able to
> successfully install pltclu into one database with the command
> "createlang -U postgres pltclu dbname". Upon hitting enter, I
> was prompted
> for a password. The next time I went to run the same command,
> just on a
> different DB, I am no longer prompted for a password, and
> receive the error
> message, "createlang: could not connect to database template1: FATAL:
> password authentication failed for user "postgres". I checked
> to see if this
> error was specific to template1, by trying to install a
> different language
> on the original DB. That too failed with the same error.

Do you get something in the server log at this time? Check both the
eventlog and the logfiles in pg_log.

//Magnus

Re: Ugh...createlang won't prompt for password

From
"Steve - DND"
Date:
> Do you get something in the server log at this time? Check both the
> eventlog and the logfiles in pg_log.

Nothing in the event log, but the pg_log contained: "2005-04-19 08:48:47
FATAL:  password authentication failed for user "postgres"". Which I guess
is to be expected since createlang doesn't ask me to enter my password.

Steve



Re: Ugh...createlang won't prompt for password

From
Tom Lane
Date:
"Steve - DND" <postgres@digitalnothing.com> writes:
>> Do you get something in the server log at this time? Check both the
>> eventlog and the logfiles in pg_log.

> Nothing in the event log, but the pg_log contained: "2005-04-19 08:48:47
> FATAL:  password authentication failed for user "postgres"". Which I guess
> is to be expected since createlang doesn't ask me to enter my password.

Is it possible that createlang is getting a (wrong) password from
someplace?  Say, a PGPASSWORD environment setting, or a .pgpass
config file.

            regards, tom lane

Re: Ugh...createlang won't prompt for password

From
"Steve - DND"
Date:
>
> Is it possible that createlang is getting a (wrong) password from
> someplace?  Say, a PGPASSWORD environment setting, or a .pgpass
> config file.

I can't find any PGPASSWORD environment variable, nor could I find a .pgpass
config file. Where would the config file be located? in data/?

Would it be possible to use such a file for a temporary fix? If so, what is
the format of the file?

Steve



Re: Ugh...createlang won't prompt for password

From
John DeSoi
Date:
On Apr 19, 2005, at 7:28 PM, Steve - DND wrote:

>>
>> Is it possible that createlang is getting a (wrong) password from
>> someplace?  Say, a PGPASSWORD environment setting, or a .pgpass
>> config file.
>
> I can't find any PGPASSWORD environment variable, nor could I find a
> .pgpass
> config file. Where would the config file be located? in data/?
>
> Would it be possible to use such a file for a temporary fix? If so,
> what is
> the format of the file?


You can use the pgpass file to avoid any password prompting. The
details are here:

http://www.postgresql.org/docs/8.0/interactive/libpq-pgpass.html


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Re: Ugh...createlang won't prompt for password

From
"Steve - DND"
Date:
>
>
> You can use the pgpass file to avoid any password prompting. The
> details are here:
>
> http://www.postgresql.org/docs/8.0/interactive/libpq-pgpass.html

That file at the location specified in the above link did not appear in any
of my user's profiles. Creating the file at the specified location though
caused createlang to work as expected. So I guess the question now is, why
wasn't createlang or psql prompting me for a password like they were
supposed to? Even when I tried to force password prompting.

Steve