Better auth errors from libpq

Started by David Fetterover 17 years ago18 messages
#1David Fetter
david@fetter.org
1 attachment(s)

Folks,

Far and away the most common question we get in IRC includes phrases
like:

psql: FATAL: Ident authentication failed for user "root"

This isn't exactly informative to newbies, so I'm proposing a patch
like that attached for such failures. Instead of seeing that
mysterious message, they'd get something like this:

psql: FATAL: Ident authentication failed for user "root"
HINT: Is pg_hba.conf set properly on the server?

Also good would be some way to make man pages and whatever Windows
uses both for pg_hba.conf and for postgresql.conf. Any hints as to
how to start this would be most welcome :)

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Attachments:

hint.difftext/plain; charset=us-asciiDownload
? GNUmakefile
? config.log
? config.status
? hint.diff
? src/Makefile.global
? src/backend/postgres
? src/backend/catalog/postgres.bki
? src/backend/catalog/postgres.description
? src/backend/catalog/postgres.shdescription
? src/backend/snowball/snowball_create.sql
? src/backend/utils/probes.h
? src/backend/utils/mb/conversion_procs/conversion_create.sql
? src/bin/initdb/initdb
? src/bin/pg_config/pg_config
? src/bin/pg_controldata/pg_controldata
? src/bin/pg_ctl/pg_ctl
? src/bin/pg_dump/pg_dump
? src/bin/pg_dump/pg_dumpall
? src/bin/pg_dump/pg_restore
? src/bin/pg_resetxlog/pg_resetxlog
? src/bin/psql/psql
? src/bin/scripts/clusterdb
? src/bin/scripts/createdb
? src/bin/scripts/createlang
? src/bin/scripts/createuser
? src/bin/scripts/dropdb
? src/bin/scripts/droplang
? src/bin/scripts/dropuser
? src/bin/scripts/reindexdb
? src/bin/scripts/vacuumdb
? src/include/pg_config.h
? src/include/stamp-h
? src/interfaces/ecpg/compatlib/exports.list
? src/interfaces/ecpg/compatlib/libecpg_compat.so.3.1
? src/interfaces/ecpg/ecpglib/exports.list
? src/interfaces/ecpg/ecpglib/libecpg.so.6.1
? src/interfaces/ecpg/include/ecpg_config.h
? src/interfaces/ecpg/pgtypeslib/exports.list
? src/interfaces/ecpg/pgtypeslib/libpgtypes.so.3.1
? src/interfaces/ecpg/preproc/ecpg
? src/interfaces/libpq/exports.list
? src/interfaces/libpq/libpq.so.5.2
? src/port/pg_config_paths.h
? src/test/regress/log
? src/test/regress/pg_regress
? src/test/regress/results
? src/test/regress/testtablespace
? src/test/regress/tmp_check
? src/test/regress/expected/constraints.out
? src/test/regress/expected/copy.out
? src/test/regress/expected/create_function_1.out
? src/test/regress/expected/create_function_2.out
? src/test/regress/expected/largeobject.out
? src/test/regress/expected/largeobject_1.out
? src/test/regress/expected/misc.out
? src/test/regress/expected/tablespace.out
? src/test/regress/sql/constraints.sql
? src/test/regress/sql/copy.sql
? src/test/regress/sql/create_function_1.sql
? src/test/regress/sql/create_function_2.sql
? src/test/regress/sql/largeobject.sql
? src/test/regress/sql/misc.sql
? src/test/regress/sql/tablespace.sql
? src/timezone/zic
Index: src/backend/libpq/auth.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/libpq/auth.c,v
retrieving revision 1.167
diff -c -r1.167 auth.c
*** src/backend/libpq/auth.c	1 Aug 2008 11:41:12 -0000	1.167
--- src/backend/libpq/auth.c	12 Sep 2008 02:41:43 -0000
***************
*** 197,202 ****
--- 197,204 ----
  auth_failed(Port *port, int status)
  {
  	const char *errstr;
+ 	const char *hintstr;
+ 	hintstr = gettext_noop("Is pg_hba.conf set properly on the server?");
  
  	/*
  	 * If we failed due to EOF from client, just quit; there's no point in
***************
*** 253,259 ****
  
  	ereport(FATAL,
  			(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
! 			 errmsg(errstr, port->user_name)));
  	/* doesn't return */
  }
  
--- 255,262 ----
  
  	ereport(FATAL,
  			(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
! 			 errmsg(errstr, port->user_name),
! 			 errhint(hintstr)));
  	/* doesn't return */
  }
  
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Fetter (#1)
Re: Better auth errors from libpq

David Fetter <david@fetter.org> writes:

This isn't exactly informative to newbies, so I'm proposing a patch
like that attached for such failures. Instead of seeing that
mysterious message, they'd get something like this:

psql: FATAL: Ident authentication failed for user "root"
HINT: Is pg_hba.conf set properly on the server?

Seems pretty useless. What does "set properly" mean? There isn't even
any good reason to think that the solution to most auth failures is to
change pg_hba.conf, so I'd bet that this hint is wrong far more often
than it's right.

You have to recall also that we deliberately suppress details in auth
failure messages sent to the client, since they might provide useful
clues to someone trying to break in. Admittedly, the above is so
content-free that it gives no aid or comfort to an attacker, but
I don't see that it provides any to a novice DBA either.

regards, tom lane

#3Joshua Drake
jd@commandprompt.com
In reply to: Tom Lane (#2)
Re: Better auth errors from libpq

On Thu, 11 Sep 2008 22:59:40 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:

psql: FATAL: Ident authentication failed for user "root"
HINT: Is pg_hba.conf set properly on the server?

Seems pretty useless. What does "set properly" mean? There isn't
even any good reason to think that the solution to most auth failures
is to change pg_hba.conf, so I'd bet that this hint is wrong far more
often than it's right.

I think something like:

psql: FATAL: Ident authentication failed for user "root"
HINT: http://www.postgresql.org/docs/8.3/static/client-authentication.html

Would be nice. Heck in most modern terminals the HINT would be
clickable too :)

Sincerely,

Joshua D. Drake
--
The PostgreSQL Company since 1997: http://www.commandprompt.com/
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

#4David Fetter
david@fetter.org
In reply to: Joshua Drake (#3)
Re: Better auth errors from libpq

On Thu, Sep 11, 2008 at 08:10:45PM -0700, Joshua D. Drake wrote:

On Thu, 11 Sep 2008 22:59:40 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:

psql: FATAL: Ident authentication failed for user "root"
HINT: Is pg_hba.conf set properly on the server?

Seems pretty useless. What does "set properly" mean? There isn't
even any good reason to think that the solution to most auth failures
is to change pg_hba.conf, so I'd bet that this hint is wrong far more
often than it's right.

I think something like:

psql: FATAL: Ident authentication failed for user "root"
HINT: http://www.postgresql.org/docs/8.3/static/client-authentication.html

Would be nice. Heck in most modern terminals the HINT would be
clickable too :)

I'm all for something, and that's a much better something. What we
have now--nothing--actively distresses newbies for no good reason.

I don't know how many people we've lost right at that point, but the
number has to be high, as most people don't just hop into IRC with
their problem.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joshua Drake (#3)
Re: Better auth errors from libpq

Joshua Drake <jd@commandprompt.com> writes:

I think something like:

psql: FATAL: Ident authentication failed for user "root"
HINT: http://www.postgresql.org/docs/8.3/static/client-authentication.html

Would be nice.

Do you really think that's helpful in the typical case where someone
fat-fingered their password?

I'm not averse to hint messages that are actually helpful, ie,
reasonably connected to the *specific* failure situation. The problem
I've got with David's proposal is that it provides a one-size-fits-all
hint for every possible auth failure. One size does not fit all here.

Or to put it even more baldly: this is not an area in which you can
improve matters significantly with five minutes' thought and a one-line
patch. It would take some actual work.

regards, tom lane

#6David Fetter
david@fetter.org
In reply to: Tom Lane (#5)
Re: Better auth errors from libpq

On Thu, Sep 11, 2008 at 11:28:36PM -0400, Tom Lane wrote:

Joshua Drake <jd@commandprompt.com> writes:

I think something like:

psql: FATAL: Ident authentication failed for user "root"
HINT: http://www.postgresql.org/docs/8.3/static/client-authentication.html

Would be nice.

Do you really think that's helpful in the typical case where someone
fat-fingered their password?

Possibly not.

I'm not averse to hint messages that are actually helpful, ie,
reasonably connected to the *specific* failure situation. The
problem I've got with David's proposal is that it provides a
one-size-fits-all hint for every possible auth failure. One size
does not fit all here.

I'd be delighted to make more different sizes.

Or to put it even more baldly: this is not an area in which you can
improve matters significantly with five minutes' thought and a
one-line patch. It would take some actual work.

It's work that hasn't yet been done, and thanks for your input on the
first versions :)

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#7David Fetter
david@fetter.org
In reply to: Tom Lane (#5)
1 attachment(s)
Re: Better auth errors from libpq

On Thu, Sep 11, 2008 at 11:28:36PM -0400, Tom Lane wrote:

Joshua Drake <jd@commandprompt.com> writes:

I think something like:

psql: FATAL: Ident authentication failed for user "root"
HINT: http://www.postgresql.org/docs/8.3/static/client-authentication.html

Would be nice.

Do you really think that's helpful in the typical case where someone
fat-fingered their password?

I'm not averse to hint messages that are actually helpful, ie,
reasonably connected to the *specific* failure situation. The problem
I've got with David's proposal is that it provides a one-size-fits-all
hint for every possible auth failure. One size does not fit all here.

Here's a few different sizes: one for each auth method.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Attachments:

hint.difftext/plain; charset=us-asciiDownload
Index: src/backend/libpq/auth.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/libpq/auth.c,v
retrieving revision 1.167
diff -c -r1.167 auth.c
*** src/backend/libpq/auth.c	1 Aug 2008 11:41:12 -0000	1.167
--- src/backend/libpq/auth.c	12 Sep 2008 03:51:29 -0000
***************
*** 197,202 ****
--- 197,203 ----
  auth_failed(Port *port, int status)
  {
  	const char *errstr;
+ 	const char *hintstr;
  
  	/*
  	 * If we failed due to EOF from client, just quit; there's no point in
***************
*** 215,259 ****
  	{
  		case uaReject:
  			errstr = gettext_noop("authentication failed for user \"%s\": host rejected");
  			break;
  		case uaKrb5:
  			errstr = gettext_noop("Kerberos 5 authentication failed for user \"%s\"");
  			break;
  		case uaGSS:
  			errstr = gettext_noop("GSSAPI authentication failed for user \"%s\"");
  			break;
  		case uaSSPI:
  			errstr = gettext_noop("SSPI authentication failed for user \"%s\"");
  			break;
  		case uaTrust:
  			errstr = gettext_noop("\"trust\" authentication failed for user \"%s\"");
  			break;
  		case uaIdent:
  			errstr = gettext_noop("Ident authentication failed for user \"%s\"");
  			break;
  		case uaMD5:
  		case uaCrypt:
  		case uaPassword:
  			errstr = gettext_noop("password authentication failed for user \"%s\"");
  			break;
  #ifdef USE_PAM
  		case uaPAM:
  			errstr = gettext_noop("PAM authentication failed for user \"%s\"");
  			break;
  #endif   /* USE_PAM */
  #ifdef USE_LDAP
  		case uaLDAP:
  			errstr = gettext_noop("LDAP authentication failed for user \"%s\"");
  			break;
  #endif   /* USE_LDAP */
  		default:
  			errstr = gettext_noop("authentication failed for user \"%s\": invalid authentication method");
  			break;
  	}
  
  	ereport(FATAL,
  			(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
! 			 errmsg(errstr, port->user_name)));
  	/* doesn't return */
  }
  
--- 216,271 ----
  	{
  		case uaReject:
  			errstr = gettext_noop("authentication failed for user \"%s\": host rejected");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/auth-methods.html");
  			break;
  		case uaKrb5:
  			errstr = gettext_noop("Kerberos 5 authentication failed for user \"%s\"");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/auth-methods.html#GSSAPI-AUTH");
  			break;
  		case uaGSS:
  			errstr = gettext_noop("GSSAPI authentication failed for user \"%s\"");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/auth-methods.html#GSSAPI-AUTH");
  			break;
  		case uaSSPI:
  			errstr = gettext_noop("SSPI authentication failed for user \"%s\"");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/auth-methods.html#SSPI-AUTH");
  			break;
  		case uaTrust:
  			errstr = gettext_noop("\"trust\" authentication failed for user \"%s\"");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/auth-methods.html#TRUST-AUTH");
  			break;
  		case uaIdent:
  			errstr = gettext_noop("Ident authentication failed for user \"%s\"");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/client-authentication.html#AUTH-IDENT");
  			break;
  		case uaMD5:
  		case uaCrypt:
  		case uaPassword:
  			errstr = gettext_noop("password authentication failed for user \"%s\"");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/auth-methods.html#AUTH-PASSWORD");
  			break;
  #ifdef USE_PAM
  		case uaPAM:
  			errstr = gettext_noop("PAM authentication failed for user \"%s\"");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/auth-methods.html#AUTH-PAM");
  			break;
  #endif   /* USE_PAM */
  #ifdef USE_LDAP
  		case uaLDAP:
  			errstr = gettext_noop("LDAP authentication failed for user \"%s\"");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/auth-methods.html#AUTH-PAM");
  			break;
  #endif   /* USE_LDAP */
  		default:
  			errstr = gettext_noop("authentication failed for user \"%s\": invalid authentication method");
+ 			hintstr = gettext_noop("http://www.postgresql.org/docs/current/static/auth-methods.html");
  			break;
  	}
  
  	ereport(FATAL,
  			(errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION),
! 			 errmsg(errstr, port->user_name),
! 			 errhint(hintstr)));
  	/* doesn't return */
  }
  
#8Joshua D. Drake
jd@commandprompt.com
In reply to: Tom Lane (#5)
Re: Better auth errors from libpq

Tom Lane wrote:

Joshua Drake <jd@commandprompt.com> writes:

I think something like:

psql: FATAL: Ident authentication failed for user "root"
HINT: http://www.postgresql.org/docs/8.3/static/client-authentication.html

Would be nice.

Do you really think that's helpful in the typical case where someone
fat-fingered their password?

No but I do think it is helpful based on the error provided.

I'm not averse to hint messages that are actually helpful, ie,
reasonably connected to the *specific* failure situation. The problem
I've got with David's proposal is that it provides a one-size-fits-all
hint for every possible auth failure. One size does not fit all here.

I can agree with that.

Or to put it even more baldly: this is not an area in which you can
improve matters significantly with five minutes' thought and a one-line
patch. It would take some actual work.

Fair enough.

Joshua D. Drake

Show quoted text

regards, tom lane

#9Joshua D. Drake
jd@commandprompt.com
In reply to: David Fetter (#7)
Re: Better auth errors from libpq

David Fetter wrote:

On Thu, Sep 11, 2008 at 11:28:36PM -0400, Tom Lane wrote:

Joshua Drake <jd@commandprompt.com> writes:

I think something like:
psql: FATAL: Ident authentication failed for user "root"
HINT: http://www.postgresql.org/docs/8.3/static/client-authentication.html
Would be nice.

Do you really think that's helpful in the typical case where someone
fat-fingered their password?

I'm not averse to hint messages that are actually helpful, ie,
reasonably connected to the *specific* failure situation. The problem
I've got with David's proposal is that it provides a one-size-fits-all
hint for every possible auth failure. One size does not fit all here.

Here's a few different sizes: one for each auth method.

The only thing I would say here is that you point the URL to current
which will be wrong in one release. Perhaps something that pulls the
pgversion macro?

Sincerely,

Joshua D. Drake

Show quoted text

Cheers,
David.

#10Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Joshua D. Drake (#9)
Re: Better auth errors from libpq

Joshua D. Drake wrote:

David Fetter wrote:

On Thu, Sep 11, 2008 at 11:28:36PM -0400, Tom Lane wrote:

Joshua Drake <jd@commandprompt.com> writes:

I think something like:
psql: FATAL: Ident authentication failed for user "root"
HINT:
http://www.postgresql.org/docs/8.3/static/client-authentication.html
Would be nice.

Do you really think that's helpful in the typical case where someone
fat-fingered their password?

I'm not averse to hint messages that are actually helpful, ie,
reasonably connected to the *specific* failure situation. The problem
I've got with David's proposal is that it provides a one-size-fits-all
hint for every possible auth failure. One size does not fit all here.

Here's a few different sizes: one for each auth method.

The only thing I would say here is that you point the URL to current
which will be wrong in one release. Perhaps something that pulls the
pgversion macro?

We don't put URLs in error messages. The hint needs to be a real sentence.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#11Gregory Stark
stark@enterprisedb.com
In reply to: Tom Lane (#5)
Re: Better auth errors from libpq

Tom Lane <tgl@sss.pgh.pa.us> writes:

Joshua Drake <jd@commandprompt.com> writes:

I think something like:

psql: FATAL: Ident authentication failed for user "root"
HINT: http://www.postgresql.org/docs/8.3/static/client-authentication.html

Would be nice.

...

Or to put it even more baldly: this is not an area in which you can
improve matters significantly with five minutes' thought and a one-line
patch. It would take some actual work.

Actually I think there is a problem with the original message that could be
improved. The problem is that "Ident" is a Postgres-specific term that a
newbie DBA is unlikely to understand. What's worse it's an ambiguous term that
is easily misunderstood to refer to the rfc1413 ident protocol which Postgres
might or might not be using.

I would suggest instead describing it using more generic terminology though
offhand I'm not sure what that would be. A detail line could include the
Postgres-specific authentication method which failed.

I do think it's true that the pg_hba setup is far more complex than it has to
be and that that's a bigger problem than a simple error message too.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

#12Markus Wanner
markus@bluegap.ch
In reply to: David Fetter (#4)
Re: Better auth errors from libpq

Hi,

David Fetter wrote:

I'm all for something, and that's a much better something. What we
have now--nothing--actively distresses newbies for no good reason.

I don't know how many people we've lost right at that point, but the
number has to be high, as most people don't just hop into IRC with
their problem.

Maybe something much more specific, i.e. triggering only if one tried to
connect via localhost or unix sockets, and only if one tried to
authenticate as 'root' without a password.

The hint shoud IMO say something like: "The default superuser is
postgres, not root". Something that's useful for this specific case and
doesn't disturb in others. And something that's public knowledge, which
any reasonably serious attacker already knows anyway.

Maybe also point out that the unix user is chosen by default. Assuming
that most of these users didn't explicitly type 'root' and are wondering
where that 'root' user came from.

Regards

Markus Wanner

#13David Fetter
david@fetter.org
In reply to: Markus Wanner (#12)
Re: Better auth errors from libpq

On Fri, Sep 12, 2008 at 10:08:56AM +0200, Markus Schiltknecht wrote:

Hi,

David Fetter wrote:

I'm all for something, and that's a much better something. What we
have now--nothing--actively distresses newbies for no good reason.

I don't know how many people we've lost right at that point, but
the number has to be high, as most people don't just hop into IRC
with their problem.

Maybe something much more specific, i.e. triggering only if one
tried to connect via localhost or unix sockets, and only if one
tried to authenticate as 'root' without a password.

It's not the root part that confuses people, but the entire message.

The hint shoud IMO say something like: "The default superuser is
postgres, not root". Something that's useful for this specific case
and doesn't disturb in others. And something that's public
knowledge, which any reasonably serious attacker already knows
anyway.

I, too, disagree with the "security by obscurity" approach to auth
error messages. A system cracker will not be deterred by any such a
thing, but a new user can easily be.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#14David Fetter
david@fetter.org
In reply to: Gregory Stark (#11)
Re: Better auth errors from libpq

On Fri, Sep 12, 2008 at 08:53:39AM +0100, Gregory Stark wrote:

Tom Lane <tgl@sss.pgh.pa.us> writes:

Joshua Drake <jd@commandprompt.com> writes:

I think something like:

psql: FATAL: Ident authentication failed for user "root"
HINT: http://www.postgresql.org/docs/8.3/static/client-authentication.html

Would be nice.

...

Or to put it even more baldly: this is not an area in which you
can improve matters significantly with five minutes' thought and a
one-line patch. It would take some actual work.

Actually I think there is a problem with the original message that
could be improved. The problem is that "Ident" is a
Postgres-specific term that a newbie DBA is unlikely to understand.
What's worse it's an ambiguous term that is easily misunderstood to
refer to the rfc1413 ident protocol which Postgres might or might
not be using.

For "Ident" auth, we need to split that functionality into two
separate pieces: socket and network, and add descriptive error
messages for each.

I would suggest instead describing it using more generic terminology
though offhand I'm not sure what that would be. A detail line could
include the Postgres-specific authentication method which failed.

Excellent idea :)

I do think it's true that the pg_hba setup is far more complex than
it has to be and that that's a bigger problem than a simple error
message too.

Agreed. Any ideas as to how we might address this?

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#15Joshua D. Drake
jd@commandprompt.com
In reply to: Heikki Linnakangas (#10)
Re: Better auth errors from libpq

Heikki Linnakangas wrote:

The only thing I would say here is that you point the URL to current
which will be wrong in one release. Perhaps something that pulls the
pgversion macro?

We don't put URLs in error messages. The hint needs to be a real sentence.

Which is exactly why its the first thing we do when supporting people.
Point them to the URL in the docs.

Perhaps the middle man isn't needed.

Joshua D. Drake

#16Alvaro Herrera
alvherre@commandprompt.com
In reply to: Joshua D. Drake (#15)
Re: Better auth errors from libpq

Joshua D. Drake wrote:

Heikki Linnakangas wrote:

The only thing I would say here is that you point the URL to current
which will be wrong in one release. Perhaps something that pulls the
pgversion macro?

We don't put URLs in error messages. The hint needs to be a real sentence.

Which is exactly why its the first thing we do when supporting people.
Point them to the URL in the docs.

Let's add a new field in error reports: errurl()

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#17David Fetter
david@fetter.org
In reply to: Alvaro Herrera (#16)
Re: Better auth errors from libpq

On Fri, Sep 12, 2008 at 12:30:12PM -0400, Alvaro Herrera wrote:

Joshua D. Drake wrote:

Heikki Linnakangas wrote:

The only thing I would say here is that you point the URL to
current which will be wrong in one release. Perhaps something
that pulls the pgversion macro?

We don't put URLs in error messages. The hint needs to be a real
sentence.

Which is exactly why its the first thing we do when supporting
people. Point them to the URL in the docs.

Let's add a new field in error reports: errurl()

Excellent idea :)

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#18Andrew Chernow
ac@esilo.com
In reply to: David Fetter (#17)
Re: Better auth errors from libpq

David Fetter wrote:

On Fri, Sep 12, 2008 at 12:30:12PM -0400, Alvaro Herrera wrote:

Joshua D. Drake wrote:

Heikki Linnakangas wrote:

The only thing I would say here is that you point the URL to
current which will be wrong in one release. Perhaps something
that pulls the pgversion macro?

We don't put URLs in error messages. The hint needs to be a real
sentence.

Which is exactly why its the first thing we do when supporting
people. Point them to the URL in the docs.

Let's add a new field in error reports: errurl()

Excellent idea :)

Cheers,
David.

If you start using urls in error messages, it might be helpful to point
everything at a single url and only change the query_string, maybe....

http://www.postgresql.org/docs/?err_id

Not sure if err_id is the correct value for the query_string, but I'm
sure something like the above would simply/centralize management.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/