Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement sql.Pinger interface #533

Closed
itsjamie opened this issue Nov 6, 2016 · 2 comments
Closed

Implement sql.Pinger interface #533

itsjamie opened this issue Nov 6, 2016 · 2 comments

Comments

@itsjamie
Copy link

itsjamie commented Nov 6, 2016

Looking at issue #531, I was thinking about implementing and submitting an implementation of Pinger.

I read a few posts around, and it might be worthwhile to put a value on the context for determining if you're communicating with a pgBouncer instance or Postgres directly?

I did find a bug that was mentioned in the Perl database handler...
Post
Commit related

Essentially, implementation of ping similar to the Perl DBH package by executing /* libpq ping test */ would destroy the state of any running COPY statements. Would this be something to consider?

@rskumar
Copy link

rskumar commented Oct 23, 2017

Is it being implemented? Currently, in absence of driver.Pringer implementation, go does not return valid state. If once DB connection is made initiallly, GO sql Ping() returns success even if DB is down at the moment.

@itsjamie
Copy link
Author

I've not been implementing it, was waiting to hear if anyone had a problem with the command breaking COPY statements since it's part of the interface, and someone might unwillingly execute the Ping() command not knowing this, especially if they don't check out the driver documentation.

But if you want to implement it @rskumar please go ahead. Otherwise, I'll submit a PR for this likely in two weeks if I don't hear back, and we can have the conversation on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants