pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14877: DISCARD ALL incorrectly resets user parameters
5+ messages / 3 participants
[nested] [flat]

* BUG #14877: DISCARD ALL incorrectly resets user parameters
@ 2017-10-27 13:21 dmitriy@riabov.info
  2017-10-27 13:43 ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters Fabrízio de Royes Mello <fabriziomello@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: dmitriy@riabov.info @ 2017-10-27 13:21 UTC (permalink / raw)
  To: pgsql-bugs; +Cc: dmitriy@riabov.info

The following bug has been logged on the website:

Bug reference:      14877
Logged by:          Dmitriy Riabov
Email address:      dmitriy@riabov.info
PostgreSQL version: 10.0
Operating system:   Debian 8
Description:        

Affected versions: 9.4 - 10. Versions prior to 9.4 haven't been tested.

How to reproduce the bug:

# psql testdb

testdb=# select current_setting('var.test');
ERROR:  unrecognized configuration parameter "var.test"
testdb=# select set_config('var.test', '123', false);
 set_config 
------------
 123
(1 row)

testdb=# select current_setting('var.test');
 current_setting 
-----------------
 123
(1 row)

testdb=# discard all;
DISCARD ALL
testdb=# select current_setting('var.test');
 current_setting 
-----------------
 
(1 row)



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #14877: DISCARD ALL incorrectly resets user parameters
  2017-10-27 13:21 BUG #14877: DISCARD ALL incorrectly resets user parameters dmitriy@riabov.info
@ 2017-10-27 13:43 ` Fabrízio de Royes Mello <fabriziomello@gmail.com>
  2017-10-27 14:05   ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Fabrízio de Royes Mello @ 2017-10-27 13:43 UTC (permalink / raw)
  To: dmitriy@riabov.info; +Cc: pgsql-bugs

On Fri, Oct 27, 2017 at 11:21 AM, <dmitriy@riabov.info> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference:      14877
> Logged by:          Dmitriy Riabov
> Email address:      dmitriy@riabov.info
> PostgreSQL version: 10.0
> Operating system:   Debian 8
> Description:
>
> Affected versions: 9.4 - 10. Versions prior to 9.4 haven't been tested.
>
> How to reproduce the bug:
>
> # psql testdb
>
> testdb=# select current_setting('var.test');
> ERROR:  unrecognized configuration parameter "var.test"
> testdb=# select set_config('var.test', '123', false);
>  set_config
> ------------
>  123
> (1 row)
>
> testdb=# select current_setting('var.test');
>  current_setting
> -----------------
>  123
> (1 row)
>
> testdb=# discard all;
> DISCARD ALL
> testdb=# select current_setting('var.test');
>  current_setting
> -----------------
>
> (1 row)
>

Why do you think this wrong? This is the default behavior of DISCARD ALL
since when 8.3 introduced it.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #14877: DISCARD ALL incorrectly resets user parameters
  2017-10-27 13:21 BUG #14877: DISCARD ALL incorrectly resets user parameters dmitriy@riabov.info
  2017-10-27 13:43 ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters Fabrízio de Royes Mello <fabriziomello@gmail.com>
@ 2017-10-27 14:05   ` David G. Johnston <david.g.johnston@gmail.com>
  2017-10-27 14:22     ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters Fabrízio de Royes Mello <fabriziomello@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2017-10-27 14:05 UTC (permalink / raw)
  To: fabriziomello@gmail.com <fabriziomello@gmail.com>; +Cc: pgsql-bugs

On Fri, Oct 27, 2017 at 6:43 AM, Fabrízio de Royes Mello <
fabriziomello@gmail.com> wrote:

>
> > Bug reference:      14877
> > Logged by:          Dmitriy Riabov
> >
> Why do you think this wrong? This is the default behavior of DISCARD ALL
> since when 8.3 introduced it.
>
>
​Docs say DISCARD ALL means:

​SET SESSION AUTHORIZATION DEFAULT;
RESET ALL;
DEALLOCATE ALL;
CLOSE ALL;
UNLISTEN *;
SELECT pg_advisory_unlock_all();
DISCARD PLANS;
DISCARD SEQUENCES;
DISCARD TEMP;

The "RESET ALL" command is what causes the GUCs to be reset.  If you don't
wish for them to be reset create a function the does all of the above minus
the RESET ALL.

David J.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #14877: DISCARD ALL incorrectly resets user parameters
  2017-10-27 13:21 BUG #14877: DISCARD ALL incorrectly resets user parameters dmitriy@riabov.info
  2017-10-27 13:43 ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters Fabrízio de Royes Mello <fabriziomello@gmail.com>
  2017-10-27 14:05   ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters David G. Johnston <david.g.johnston@gmail.com>
@ 2017-10-27 14:22     ` Fabrízio de Royes Mello <fabriziomello@gmail.com>
  2017-10-27 14:26       ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Fabrízio de Royes Mello @ 2017-10-27 14:22 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-bugs

On Fri, Oct 27, 2017 at 12:05 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:
>
> On Fri, Oct 27, 2017 at 6:43 AM, Fabrízio de Royes Mello <
fabriziomello@gmail.com> wrote:
>>
>>
>> > Bug reference:      14877
>> > Logged by:          Dmitriy Riabov
>> >
>> Why do you think this wrong? This is the default behavior of DISCARD ALL
since when 8.3 introduced it.
>>
>
> Docs say DISCARD ALL means:
>
> SET SESSION AUTHORIZATION DEFAULT;
> RESET ALL;
> DEALLOCATE ALL;
> CLOSE ALL;
> UNLISTEN *;
> SELECT pg_advisory_unlock_all();
> DISCARD PLANS;
> DISCARD SEQUENCES;
> DISCARD TEMP;
>
> The "RESET ALL" command is what causes the GUCs to be reset.  If you
don't wish for them to be reset create a function the does all of the above
minus the RESET ALL.
>

I wonder if be nice to have some new DISCARD construct to cover different
use cases, something like:

DISCARD { ALL | PLANS | TEMP | SEQUENCES | ( { SESSION AUTHORIZARION |
RESET | PREPARED STATEMENT | CURSORS | NOTIFY | ADVISORY LOCKS | PLANS |
SEQUENCES | TEMP } [, ...] ) }

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #14877: DISCARD ALL incorrectly resets user parameters
  2017-10-27 13:21 BUG #14877: DISCARD ALL incorrectly resets user parameters dmitriy@riabov.info
  2017-10-27 13:43 ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters Fabrízio de Royes Mello <fabriziomello@gmail.com>
  2017-10-27 14:05   ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters David G. Johnston <david.g.johnston@gmail.com>
  2017-10-27 14:22     ` Re: BUG #14877: DISCARD ALL incorrectly resets user parameters Fabrízio de Royes Mello <fabriziomello@gmail.com>
@ 2017-10-27 14:26       ` David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: David G. Johnston @ 2017-10-27 14:26 UTC (permalink / raw)
  To: fabriziomello@gmail.com <fabriziomello@gmail.com>; +Cc: pgsql-bugs

On Fri, Oct 27, 2017 at 7:22 AM, Fabrízio de Royes Mello <
fabriziomello@gmail.com> wrote:

> On Fri, Oct 27, 2017 at 12:05 PM, David G. Johnston <
> david.g.johnston@gmail.com> wrote:
>
> I wonder if be nice to have some new DISCARD construct to cover different
> use cases, something like:
>
> DISCARD { ALL | PLANS | TEMP | SEQUENCES | ( { SESSION AUTHORIZARION |
> RESET | PREPARED STATEMENT | CURSORS | NOTIFY | ADVISORY LOCKS | PLANS |
> SEQUENCES | TEMP } [, ...] ) }
>
>
​DISCARD ALL ( RESET false ) ...​

David J.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2017-10-27 14:26 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-10-27 13:21 BUG #14877: DISCARD ALL incorrectly resets user parameters dmitriy@riabov.info
2017-10-27 13:43 ` Fabrízio de Royes Mello <fabriziomello@gmail.com>
2017-10-27 14:05   ` David G. Johnston <david.g.johnston@gmail.com>
2017-10-27 14:22     ` Fabrízio de Royes Mello <fabriziomello@gmail.com>
2017-10-27 14:26       ` David G. Johnston <david.g.johnston@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