Skip site navigation (1) Skip section navigation (2)

Re: Warning about invalid .pgpass passwords

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Warning about invalid .pgpass passwords
Date: 2010-03-11 21:55:22
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Alvaro Herrera wrote:
>> This bit seems strange ...  I think we just do strcmp() to compare sqlstates?

> Uh, the PQresultErrorField is a string, while
> ERRCODE_INVALID_PASSWORD_SPECIFICATI is a 4-byte value in base-64.  
> Yea, it's true.  For excitement, see the MAKE_SQLSTATE macro.

I don't particularly believe in doing things this way: I think that
libpq should just hardwire the string the same as it's doing for the
other specific sqlstate it's checking for.  If we do this at all,
then we are effectively embedding that sqlstate value in the protocol.
We are not going to be able to change it later.  Doing it like this
opens us up to randomly using errcodes in the frontend without realizing
that we've thereby lost the freedom to change them.

Even if you insist on including errcodes.h into the frontend code
despite that, this is an ugly brute-force way of solving the problem.
The intended way of solving the problem was to redefine MAKE_SQLSTATE
before including the file, in .c files where you need a different

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2010-03-11 22:05:05
Subject: Re: plperl db access documentation enhancement
Previous:From: Kevin GrittnerDate: 2010-03-11 21:52:08
Subject: Re: HeapTupleData.t_self garbage values

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group