Re: How to determine failed connection attempt due to invalid authorization (libpq)?

Lists: pgsql-hackers
From: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: How to determine failed connection attempt due to invalid authorization (libpq)?
Date: 2010-10-14 18:59:00
Message-ID: AANLkTimK5-eoighBCPTLQvO67XinS5EUfWO_ukN_E9L4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hey all,

Is there way to determine failed connection attempt due to invalid
authorization (libpq)?

--
// Dmitriy.


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to determine failed connection attempt due to invalid authorization (libpq)?
Date: 2010-10-17 02:32:25
Message-ID: AANLkTi=WDEKeQ-QQR43JR51fxe3tVw6wJuqX23KbTu5X@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Oct 14, 2010 at 2:59 PM, Dmitriy Igrishin <dmitigr(at)gmail(dot)com> wrote:
> Is there way to determine failed connection attempt due to invalid
> authorization (libpq)?

I think this question would be more appropriate on pgsql-general. I
suppose you would have to look at PQerrorMessage().

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to determine failed connection attempt due to invalid authorization (libpq)?
Date: 2010-10-17 06:03:28
Message-ID: AANLkTim_t6UQjCUM8yEYU=JMpEibsNFVBsZDc4xg5ZUq@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hey Robert,

I've asked pgsql-general.
Unfortunately it seems that there is no better way to do it except
parsing PQerrorMessage(). Sadly.

2010/10/17 Robert Haas <robertmhaas(at)gmail(dot)com>

> On Thu, Oct 14, 2010 at 2:59 PM, Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
> wrote:
> > Is there way to determine failed connection attempt due to invalid
> > authorization (libpq)?
>
> I think this question would be more appropriate on pgsql-general. I
> suppose you would have to look at PQerrorMessage().
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

--
// Dmitriy.


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to determine failed connection attempt due to invalid authorization (libpq)?
Date: 2010-10-18 14:03:55
Message-ID: AANLkTimMKrbjVMT03AfdDzUYc-MQ1eW+CQBK1vxuVEq6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Oct 17, 2010 at 2:03 AM, Dmitriy Igrishin <dmitigr(at)gmail(dot)com> wrote:
> I've asked pgsql-general.
> Unfortunately it seems that there is no better way to do it except
> parsing PQerrorMessage(). Sadly.

Yeah, doesn't look like it. A quick glance at the code reveals that a
PGresult can store individual error fields but a PGconn can store only
a message. :-(

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: David Fetter <david(at)fetter(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to determine failed connection attempt due to invalid authorization (libpq)?
Date: 2010-10-18 14:05:53
Message-ID: 20101018140553.GA15370@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Oct 18, 2010 at 10:03:55AM -0400, Robert Haas wrote:
> On Sun, Oct 17, 2010 at 2:03 AM, Dmitriy Igrishin <dmitigr(at)gmail(dot)com> wrote:
> > I've asked pgsql-general.
> > Unfortunately it seems that there is no better way to do it except
> > parsing PQerrorMessage(). Sadly.
>
> Yeah, doesn't look like it. A quick glance at the code reveals that a
> PGresult can store individual error fields but a PGconn can store only
> a message. :-(

Does this seem worth patching for 9.1?

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

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


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to determine failed connection attempt due to invalid authorization (libpq)?
Date: 2010-10-18 14:18:25
Message-ID: AANLkTikEGtjK86paVYkbEjXq6x7SB5h=W1c=eTgZWWXn@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Oct 18, 2010 at 10:05 AM, David Fetter <david(at)fetter(dot)org> wrote:
> On Mon, Oct 18, 2010 at 10:03:55AM -0400, Robert Haas wrote:
>> On Sun, Oct 17, 2010 at 2:03 AM, Dmitriy Igrishin <dmitigr(at)gmail(dot)com> wrote:
>> > I've asked pgsql-general.
>> > Unfortunately it seems that there is no better way to do it except
>> > parsing PQerrorMessage(). Sadly.
>>
>> Yeah, doesn't look like it.  A quick glance at the code reveals that a
>> PGresult can store individual error fields but a PGconn can store only
>> a message.   :-(
>
> Does this seem worth patching for 9.1?

Please feel free to submit a patch if you have an idea how to solve it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: David Fetter <david(at)fetter(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to determine failed connection attempt due to invalid authorization (libpq)?
Date: 2010-10-18 14:26:32
Message-ID: 20101018142632.GA17337@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Oct 18, 2010 at 10:18:25AM -0400, Robert Haas wrote:
> On Mon, Oct 18, 2010 at 10:05 AM, David Fetter <david(at)fetter(dot)org> wrote:
> > On Mon, Oct 18, 2010 at 10:03:55AM -0400, Robert Haas wrote:
> >> On Sun, Oct 17, 2010 at 2:03 AM, Dmitriy Igrishin <dmitigr(at)gmail(dot)com> wrote:
> >> > I've asked pgsql-general.
> >> > Unfortunately it seems that there is no better way to do it except
> >> > parsing PQerrorMessage(). Sadly.
> >>
> >> Yeah, doesn't look like it.  A quick glance at the code reveals that a
> >> PGresult can store individual error fields but a PGconn can store only
> >> a message.   :-(
> >
> > Does this seem worth patching for 9.1?
>
> Please feel free to submit a patch if you have an idea how to solve it.

Will look that over this evening and submit an idea for a patch :)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

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


From: David Fetter <david(at)fetter(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to determine failed connection attempt due to invalid authorization (libpq)?
Date: 2010-10-19 06:36:07
Message-ID: 20101019063606.GH7345@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Oct 18, 2010 at 07:26:32AM -0700, David Fetter wrote:
> On Mon, Oct 18, 2010 at 10:18:25AM -0400, Robert Haas wrote:
> > On Mon, Oct 18, 2010 at 10:05 AM, David Fetter <david(at)fetter(dot)org> wrote:
> > > On Mon, Oct 18, 2010 at 10:03:55AM -0400, Robert Haas wrote:
> > >> On Sun, Oct 17, 2010 at 2:03 AM, Dmitriy Igrishin <dmitigr(at)gmail(dot)com> wrote:
> > >> > I've asked pgsql-general.
> > >> > Unfortunately it seems that there is no better way to do it except
> > >> > parsing PQerrorMessage(). Sadly.
> > >>
> > >> Yeah, doesn't look like it.  A quick glance at the code reveals that a
> > >> PGresult can store individual error fields but a PGconn can store only
> > >> a message.   :-(
> > >
> > > Does this seem worth patching for 9.1?
> >
> > Please feel free to submit a patch if you have an idea how to solve it.
>
> Will look that over this evening and submit an idea for a patch :)

I'm pretty slammed by some other commitments at the moment. Probably
won't get a chance to do this until at least this weekend.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

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