Обсуждение: reset implementation

Поиск
Список
Период
Сортировка

reset implementation

От
Daniele Varrazzo
Дата:
Hello

psycopg implements the connection.reset() method using the commands
RESET ALL and SET SESSION AUTHORIZATION DEFAULT.

Reading pgpool2 docs [1], I see that from PG 8.3 "DISCARD ALL" would
be more appropriate: it is equivalient to RESET ALL and SET SESSION
AUTHORIZATION DEFAULT plus more [2].

Ok to use DISCARD in reset() (on pg >= 8.3 only)?

[1] http://www.pgpool.net/docs/latest/doc/pgpool-en.html#RESET_QUERY_LIST
[2] http://www.postgresql.org/docs/current/static/sql-discard.html

-- Daniele

Re: reset implementation

От
Federico Di Gregorio
Дата:
On 17/05/12 17:06, Daniele Varrazzo wrote:
> Hello
>
> psycopg implements the connection.reset() method using the commands
> RESET ALL and SET SESSION AUTHORIZATION DEFAULT.
>
> Reading pgpool2 docs [1], I see that from PG 8.3 "DISCARD ALL" would
> be more appropriate: it is equivalient to RESET ALL and SET SESSION
> AUTHORIZATION DEFAULT plus more [2].

What bothers me is that executes the equivalent of:

UNLISTEN *;

IMHO that's correct for connection.reset() but I don't know how many
people out there are using NOTIFY and .reset() togheter and I don't want
to break their code.

federico

--
Federico Di Gregorio                         federico.digregorio@dndg.it
Studio Associato Di Nunzio e Di Gregorio                  http://dndg.it
 And anyone who yells "fork" deserves to get one stuck in them.
                                                          -- Dan Winship

Re: reset implementation

От
Daniele Varrazzo
Дата:
On Thu, May 17, 2012 at 4:21 PM, Federico Di Gregorio <fog@dndg.it> wrote:
> On 17/05/12 17:06, Daniele Varrazzo wrote:
>> Hello
>>
>> psycopg implements the connection.reset() method using the commands
>> RESET ALL and SET SESSION AUTHORIZATION DEFAULT.
>>
>> Reading pgpool2 docs [1], I see that from PG 8.3 "DISCARD ALL" would
>> be more appropriate: it is equivalient to RESET ALL and SET SESSION
>> AUTHORIZATION DEFAULT plus more [2].
>
> What bothers me is that executes the equivalent of:
>
> UNLISTEN *;
>
> IMHO that's correct for connection.reset() but I don't know how many
> people out there are using NOTIFY and .reset() togheter and I don't want
> to break their code.

My assumption is that if somebody calls reset() he doesn't expect the
connection to keep on doing what it was before. But I've already
created more than one issue thinking something wouldn't have had side
effects, while in real world... so I don't want to push too much on
this.

-- Daniele

Re: reset implementation

От
Federico Di Gregorio
Дата:
On 18/05/12 11:53, Daniele Varrazzo wrote:
>> > IMHO that's correct for connection.reset() but I don't know how many
>> > people out there are using NOTIFY and .reset() togheter and I don't want
>> > to break their code.
> My assumption is that if somebody calls reset() he doesn't expect the
> connection to keep on doing what it was before. But I've already
> created more than one issue thinking something wouldn't have had side
> effects, while in real world... so I don't want to push too much on
> this.

If nobody comment on this issue at all we can suppose the number of
affected people would be extremely low (and I know no big framework out
there uses connection.reset()). So it is a +1 unless someone objects.

federico

--
Federico Di Gregorio                         federico.digregorio@dndg.it
Studio Associato Di Nunzio e Di Gregorio                  http://dndg.it
   Abandon the search for Truth; settle for a good fantasy. -- Anonymous