On Fri, Jan 30, 2015 at 12:05 PM, David Fetter <david@fetter.org> wrote:
On Sat, Jan 31, 2015 at 12:50:20AM +0900, Sawada Masahiko wrote: > > [postgres][5432](1)=# select * from pg_file_settings where name = 'work_mem'; > -[ RECORD 1 ]------------------------------------------------------ > name | work_mem > setting | 128MB > sourcefile | /home/masahiko/pgsql/master/3data/hoge.conf > -[ RECORD 2 ]------------------------------------------------------ > name | work_mem > setting | 64MB > sourcefile | /home/masahiko/pgsql/master/3data/postgresql.auto.conf
Masuhiko-san,
I apologize for not communicating clearly. My alternative proposal is to add a NULL-able sourcefile column to pg_settings. This is as an alternative to creating a new pg_file_settings view.
Why might the contents of pg_settings be different from what would be in pg_file_settings, apart from the existence of this column?
The contents of pg_settings uses the setting name as a primary key.
The contents of pg_file_setting uses a compound key consisting of the setting name and the source file.
See "work_mem" in the provided example.
More specifically pg_settings only care about the "currently active setting" while this cares about "inactive" settings as well.