Re: [HACKERS] allowed user/db variables

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] allowed user/db variables
Date: 2003-06-26 05:13:16
Message-ID: 3EFA80EC.7020608@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
>>ISTM that "source" is worth knowing.
>
> Hm, possibly. Any other opinions?

This version has the seven fields I proposed, including "source". Here's
an example that shows why I think it's valuable:

regression=# \x
Expanded display is on.
regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name | enable_seqscan
setting | on
context | user
vartype | bool
source | default
min_val |
max_val |

regression=# update pg_settings set setting = 'off' where name =
'enable_seqscan';
-[ RECORD 1 ]---
set_config | off

regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name | enable_seqscan
setting | off
context | user
vartype | bool
source | session
min_val |
max_val |

regression=# alter user postgres set enable_seqscan to 'off';
ALTER USER

(log out and then back in again)

regression=# \x
Expanded display is on.
regression=# select * from pg_settings where name = 'enable_seqscan';
-[ RECORD 1 ]-----------
name | enable_seqscan
setting | off
context | user
vartype | bool
source | user
min_val |
max_val |

In the first case, enable_seqscan is set to its default value. After
setting it to off, it is obvious that the value has been changed for the
session only. In the third case, you can see that the value has been set
specifically for the user.

This version of the patch also includes documentation changes. Passes
all regression tests. Please apply.

Joe

Attachment Content-Type Size
pg_settings_expanded.2.patch text/plain 19.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message nolan 2003-06-26 07:06:34 Re: Updating psql for features of new FE/BE protocol
Previous Message Tom Lane 2003-06-26 04:15:24 Re: recursive queries

Browse pgsql-patches by date

  From Date Subject
Next Message Manuel Gil Pérez 2003-06-26 10:36:53 [PATCHES] IPv6 patch doesn't work fine
Previous Message Tom Lane 2003-06-26 02:37:48 Re: [HACKERS] allowed user/db variables