pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to disconnect a single user in Postgresql 8.2.5 from a database
10+ messages / 6 participants
[nested] [flat]
* How to disconnect a single user in Postgresql 8.2.5 from a database
@ 2010-04-19 11:27 Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Sergey Konoplev <gray.ru@gmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: Steph L @ 2010-04-19 11:27 UTC (permalink / raw)
To: pgsql-admin
How to disconnect a single user in Postgresql 8.2.5 from a database ?
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: How to disconnect a single user in Postgresql 8.2.5 from a database
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
@ 2010-04-19 15:52 ` Sergey Konoplev <gray.ru@gmail.com>
2010-04-20 01:24 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Josh Kupershmidt <schmiddy@gmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: Sergey Konoplev @ 2010-04-19 15:52 UTC (permalink / raw)
To: Steph L <engel306sl@yahoo.fr>; +Cc: pgsql-admin
On 19 April 2010 15:27, Steph L <engel306sl@yahoo.fr> wrote:
>
> How to disconnect a single user in Postgresql 8.2.5 from a database ?
AFAIK the only way is to upgrade to 8.4 and use pg_terminate_backend():
http://www.postgresql.org/docs/8.4/interactive/functions-admin.html
--
Sergey Konoplev
Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp / ICQ: 29353802
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: How to disconnect a single user in Postgresql 8.2.5 from a database
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Sergey Konoplev <gray.ru@gmail.com>
@ 2010-04-20 01:24 ` Josh Kupershmidt <schmiddy@gmail.com>
2010-04-20 02:10 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 10+ messages in thread
From: Josh Kupershmidt @ 2010-04-20 01:24 UTC (permalink / raw)
To: Sergey Konoplev <gray.ru@gmail.com>; +Cc: Steph L <engel306sl@yahoo.fr>; pgsql-admin
On Mon, Apr 19, 2010 at 11:52 AM, Sergey Konoplev <gray.ru@gmail.com> wrote:
> On 19 April 2010 15:27, Steph L <engel306sl@yahoo.fr> wrote:
>> How to disconnect a single user in Postgresql 8.2.5 from a database ?
> AFAIK the only way is to upgrade to 8.4 and use pg_terminate_backend():
> http://www.postgresql.org/docs/8.4/interactive/functions-admin.html
pg_terminate_backend() is just a SQL wrapper around:
kill -SIGTERM [backend PID]
For versions before 8.4: if you can SSH in to the server, run the
above on the PID of the backend your user is connected to, and that
should terminate their connection.
Josh
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: How to disconnect a single user in Postgresql 8.2.5 from a database
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Sergey Konoplev <gray.ru@gmail.com>
2010-04-20 01:24 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Josh Kupershmidt <schmiddy@gmail.com>
@ 2010-04-20 02:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 03:07 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Scott Marlowe <scott.marlowe@gmail.com>
0 siblings, 1 reply; 10+ messages in thread
From: Tom Lane @ 2010-04-20 02:10 UTC (permalink / raw)
To: Josh Kupershmidt <schmiddy@gmail.com>; +Cc: Sergey Konoplev <gray.ru@gmail.com>; Steph L <engel306sl@yahoo.fr>; pgsql-admin
Josh Kupershmidt <schmiddy@gmail.com> writes:
> pg_terminate_backend() is just a SQL wrapper around:
> kill -SIGTERM [backend PID]
> For versions before 8.4: if you can SSH in to the server, run the
> above on the PID of the backend your user is connected to, and that
> should terminate their connection.
The reason the function isn't there before 8.4 is that that's not
promised to work before 8.4 ... most of the time it will work, but
once in awhile you could get nasty side-effects.
regards, tom lane
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: How to disconnect a single user in Postgresql 8.2.5 from a database
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Sergey Konoplev <gray.ru@gmail.com>
2010-04-20 01:24 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Josh Kupershmidt <schmiddy@gmail.com>
2010-04-20 02:10 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
@ 2010-04-20 03:07 ` Scott Marlowe <scott.marlowe@gmail.com>
2010-04-20 13:31 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 13:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Lewis Kapell <lkapell@setonhome.org>
0 siblings, 2 replies; 10+ messages in thread
From: Scott Marlowe @ 2010-04-20 03:07 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Josh Kupershmidt <schmiddy@gmail.com>; Sergey Konoplev <gray.ru@gmail.com>; Steph L <engel306sl@yahoo.fr>; pgsql-admin
On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Josh Kupershmidt <schmiddy@gmail.com> writes:
>> pg_terminate_backend() is just a SQL wrapper around:
>> kill -SIGTERM [backend PID]
>
>> For versions before 8.4: if you can SSH in to the server, run the
>> above on the PID of the backend your user is connected to, and that
>> should terminate their connection.
>
> The reason the function isn't there before 8.4 is that that's not
> promised to work before 8.4 ... most of the time it will work, but
> once in awhile you could get nasty side-effects.
So, pg_cancel_backend(pid) is the 8.3 version, that may or may not
always work then, right?
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: How to disconnect a single user in Postgresql 8.2.5 from a database
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Sergey Konoplev <gray.ru@gmail.com>
2010-04-20 01:24 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Josh Kupershmidt <schmiddy@gmail.com>
2010-04-20 02:10 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 03:07 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Scott Marlowe <scott.marlowe@gmail.com>
@ 2010-04-20 13:31 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 14:29 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Scott Marlowe <scott.marlowe@gmail.com>
1 sibling, 1 reply; 10+ messages in thread
From: Tom Lane @ 2010-04-20 13:31 UTC (permalink / raw)
To: Scott Marlowe <scott.marlowe@gmail.com>; +Cc: Josh Kupershmidt <schmiddy@gmail.com>; Sergey Konoplev <gray.ru@gmail.com>; Steph L <engel306sl@yahoo.fr>; pgsql-admin
Scott Marlowe <scott.marlowe@gmail.com> writes:
> On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The reason the function isn't there before 8.4 is that that's not
>> promised to work before 8.4 ... most of the time it will work, but
>> once in awhile you could get nasty side-effects.
> So, pg_cancel_backend(pid) is the 8.3 version, that may or may not
> always work then, right?
No, I didn't say that.
regards, tom lane
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: How to disconnect a single user in Postgresql 8.2.5 from a database
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Sergey Konoplev <gray.ru@gmail.com>
2010-04-20 01:24 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Josh Kupershmidt <schmiddy@gmail.com>
2010-04-20 02:10 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 03:07 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Scott Marlowe <scott.marlowe@gmail.com>
2010-04-20 13:31 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
@ 2010-04-20 14:29 ` Scott Marlowe <scott.marlowe@gmail.com>
2010-04-20 14:58 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 10+ messages in thread
From: Scott Marlowe @ 2010-04-20 14:29 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Josh Kupershmidt <schmiddy@gmail.com>; Sergey Konoplev <gray.ru@gmail.com>; Steph L <engel306sl@yahoo.fr>; pgsql-admin
On Tue, Apr 20, 2010 at 7:31 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Scott Marlowe <scott.marlowe@gmail.com> writes:
>> On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> The reason the function isn't there before 8.4 is that that's not
>>> promised to work before 8.4 ... most of the time it will work, but
>>> once in awhile you could get nasty side-effects.
>
>> So, pg_cancel_backend(pid) is the 8.3 version, that may or may not
>> always work then, right?
>
> No, I didn't say that.
Well, my experience with it has been that it's similar and it doesn't
always work.
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: How to disconnect a single user in Postgresql 8.2.5 from a database
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Sergey Konoplev <gray.ru@gmail.com>
2010-04-20 01:24 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Josh Kupershmidt <schmiddy@gmail.com>
2010-04-20 02:10 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 03:07 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Scott Marlowe <scott.marlowe@gmail.com>
2010-04-20 13:31 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 14:29 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Scott Marlowe <scott.marlowe@gmail.com>
@ 2010-04-20 14:58 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 10+ messages in thread
From: Tom Lane @ 2010-04-20 14:58 UTC (permalink / raw)
To: Scott Marlowe <scott.marlowe@gmail.com>; +Cc: Josh Kupershmidt <schmiddy@gmail.com>; Sergey Konoplev <gray.ru@gmail.com>; Steph L <engel306sl@yahoo.fr>; pgsql-admin
Scott Marlowe <scott.marlowe@gmail.com> writes:
> On Tue, Apr 20, 2010 at 7:31 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Scott Marlowe <scott.marlowe@gmail.com> writes:
>>> So, pg_cancel_backend(pid) is the 8.3 version, that may or may not
>>> always work then, right?
>>
>> No, I didn't say that.
> Well, my experience with it has been that it's similar and it doesn't
> always work.
pg_cancel_backend might or might not always succeed in canceling a
query, if that's what you mean. What I'm worried about with SIGTERM'ing
an individual backend is negative side-effects, like hanging the entire
database. Before 8.4 there was never any attempt to ensure that that
would work nicely, and if memory serves we did find some problems when
we tested it.
regards, tom lane
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: How to disconnect a single user in Postgresql 8.2.5 from a database
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Sergey Konoplev <gray.ru@gmail.com>
2010-04-20 01:24 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Josh Kupershmidt <schmiddy@gmail.com>
2010-04-20 02:10 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 03:07 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Scott Marlowe <scott.marlowe@gmail.com>
@ 2010-04-20 13:52 ` Lewis Kapell <lkapell@setonhome.org>
2010-04-20 14:55 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Scott Marlowe <scott.marlowe@gmail.com>
1 sibling, 1 reply; 10+ messages in thread
From: Lewis Kapell @ 2010-04-20 13:52 UTC (permalink / raw)
To: pgsql-admin
pg_cancel_backend() and pg_terminate_backend() do different things.
From the documentation:
pg_cancel_backend(pid int) Cancel a backend's current query
pg_terminate_backend(pid int) Terminate a backend
On 4/19/2010 11:07 PM, Scott Marlowe wrote:
> On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane<tgl@sss.pgh.pa.us> wrote:
>> Josh Kupershmidt<schmiddy@gmail.com> writes:
>>> pg_terminate_backend() is just a SQL wrapper around:
>>> kill -SIGTERM [backend PID]
>>
>>> For versions before 8.4: if you can SSH in to the server, run the
>>> above on the PID of the backend your user is connected to, and that
>>> should terminate their connection.
>>
>> The reason the function isn't there before 8.4 is that that's not
>> promised to work before 8.4 ... most of the time it will work, but
>> once in awhile you could get nasty side-effects.
>
> So, pg_cancel_backend(pid) is the 8.3 version, that may or may not
> always work then, right?
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: How to disconnect a single user in Postgresql 8.2.5 from a database
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Sergey Konoplev <gray.ru@gmail.com>
2010-04-20 01:24 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Josh Kupershmidt <schmiddy@gmail.com>
2010-04-20 02:10 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 03:07 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Scott Marlowe <scott.marlowe@gmail.com>
2010-04-20 13:52 ` Re: How to disconnect a single user in Postgresql 8.2.5 from a database Lewis Kapell <lkapell@setonhome.org>
@ 2010-04-20 14:55 ` Scott Marlowe <scott.marlowe@gmail.com>
0 siblings, 0 replies; 10+ messages in thread
From: Scott Marlowe @ 2010-04-20 14:55 UTC (permalink / raw)
To: Lewis Kapell <lkapell@setonhome.org>; +Cc: pgsql-admin
Ahhh, ok.
On Tue, Apr 20, 2010 at 7:52 AM, Lewis Kapell <lkapell@setonhome.org> wrote:
> pg_cancel_backend() and pg_terminate_backend() do different things. From the
> documentation:
>
> pg_cancel_backend(pid int) Cancel a backend's current query
> pg_terminate_backend(pid int) Terminate a backend
>
>
>
> On 4/19/2010 11:07 PM, Scott Marlowe wrote:
>>
>> On Mon, Apr 19, 2010 at 8:10 PM, Tom Lane<tgl@sss.pgh.pa.us> wrote:
>>>
>>> Josh Kupershmidt<schmiddy@gmail.com> writes:
>>>>
>>>> pg_terminate_backend() is just a SQL wrapper around:
>>>> kill -SIGTERM [backend PID]
>>>
>>>> For versions before 8.4: if you can SSH in to the server, run the
>>>> above on the PID of the backend your user is connected to, and that
>>>> should terminate their connection.
>>>
>>> The reason the function isn't there before 8.4 is that that's not
>>> promised to work before 8.4 ... most of the time it will work, but
>>> once in awhile you could get nasty side-effects.
>>
>> So, pg_cancel_backend(pid) is the 8.3 version, that may or may not
>> always work then, right?
>>
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
--
When fascism comes to America, it will be intolerance sold as diversity.
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2010-04-20 14:58 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 11:27 How to disconnect a single user in Postgresql 8.2.5 from a database Steph L <engel306sl@yahoo.fr>
2010-04-19 15:52 ` Sergey Konoplev <gray.ru@gmail.com>
2010-04-20 01:24 ` Josh Kupershmidt <schmiddy@gmail.com>
2010-04-20 02:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 03:07 ` Scott Marlowe <scott.marlowe@gmail.com>
2010-04-20 13:31 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 14:29 ` Scott Marlowe <scott.marlowe@gmail.com>
2010-04-20 14:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-04-20 13:52 ` Lewis Kapell <lkapell@setonhome.org>
2010-04-20 14:55 ` Scott Marlowe <scott.marlowe@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox