Re: [PATCH] Cleanup of GUC units code

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Smith <gsmith(at)gregsmith(dot)com>, Greg Stark <stark(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Marko Kreen <markokr(at)gmail(dot)com>, Asko Oja <ascoja(at)gmail(dot)com>
Subject: Re: [PATCH] Cleanup of GUC units code
Date: 2008-09-11 11:57:58
Message-ID: 16745.1221134278@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> temp_buffers is actually special-cased in the code because

> /*
> * We show the GUC var until local buffers have been initialized, and
> * NLocBuffer afterwards.
> */

> It is not clear to me right now why that is a good idea.

I think the reason for it is that you can change the setting within a
particular session, but only up until temp buffers have been initialized
(ie, when you first touch a temp table). If we just made it act like
other GUCs then SHOW would be lying to you about the effective value
if you changed it after that point.

An easy workaround would be to make the variable PGC_BACKEND, but that
seems to me to lose useful flexibility. Or we could invent a context
category specifically for this type of behavior, but is it worth that?

The narrowest fix would be to just teach the show hook to format its
result properly. I seem to recall having looked at that and been
annoyed by the amount of copy-and-paste required.

[ thinks for a bit... ] Or maybe we should get rid of the show hook
and instead put in an assign hook that prevents changes after the
initialization event. The problem is that you can't throw error
while reading, eg, a new config file. So while this might be the most
user-friendly approach, I think it would take some API change for assign
hooks.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2008-09-11 12:02:03 Re: New FSM patch
Previous Message Heikki Linnakangas 2008-09-11 11:57:51 Re: New FSM patch