Skip site navigation (1) Skip section navigation (2)

Custom GUCs still a bit broken

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Custom GUCs still a bit broken
Date: 2010-01-20 22:07:27
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
It seems like Custom GUCs are still in need of some work, as shown in my 
recent email. In particular, they are not transaction safe - if a 
transaction attempts to do DefineCustomFooVariable() and that 
transaction aborts, the placeholder setting that it used is already gone 
by the time it tries to roll back GUC settings. I think this code at the 
end of define_custom_variable()

         * Free up as much as we conveniently can of the placeholder
         * (this neglects any stack items...)
        set_string_field(pHolder, pHolder->variable, NULL);
        set_string_field(pHolder, &pHolder->reset_val, NULL);


needs to be removed and instead we need to save pHolder in a list along 
with the GUC level, to be processed later by AtEOXact_GUC(), which would 
do the right thing according to whether or not it had a commit or an abort.

I want to get this fixed before we consider custom settings for plperl 
that have possible security implications.





pgsql-hackers by date

Next:From: Jeff DavisDate: 2010-01-20 22:08:37
Subject: Re: Listen / Notify - what to do when the queue is full
Previous:From: Greg SmithDate: 2010-01-20 22:02:07
Subject: Re: MonetDB test says that PostgreSQL often has errors or missing results

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group