Kevin Grittner wrote:
> Alvaro Herrera <alvherre@commandprompt.com> wrote:
>
> > That's within my definition of "ugly", yes :-) My ideal tool would
> > do something like
> >
> > $ pg_ping -h foo -p 5555
> > IN_RECOVERY
> > $ echo $?
> > 2
> >
> > $ # sleep a bit ...
> >
> > $ pg_ping -h foo -p 5555
> > READY
> > $ echo $?
> > 0
>
> Cool, but how would you do that without bypassing authentication? If
> you do bypass authentication, wouldn't that be sort of a big target
> for denial of service attacks?
The startup sequence lets you know that it's going to reject the
connection before checking the auth credentials; see
ProcessStartupPacket.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.