From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Security definer "generated column" function used in index
Date: Tue, 20 Dec 2011 16:53:19 -0500
Message-ID: <17366.1324417999@sss.pgh.pa.us> (raw)
In-Reply-To: <4EF0AD530200002500043EBA@gw.wicourts.gov>
References: <4EE203C20200002500043B7D@gw.wicourts.gov>
<4EF09B4B0200002500043EA3@gw.wicourts.gov>
<4EF09B4B0200002500043EA3@gw.wicourts.gov>
<16831.1324416468@sss.pgh.pa.us>
<4EF0AD530200002500043EBA@gw.wicourts.gov>
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> ... It wasn't even clear to me that it was
> OK to have one security definer function call another, based on the
> code comment I quoted, so I didn't want to spend more hours on
> attempting to create a test case if it simply wasn't supported.
Yes, that's definitely *supposed* to work, though I'll grant that there
could be bugs there. It's hard to see how it'd be a race condition
though.
On reflection what seems most likely is simply that turning these
otherwise-inlineable SQL functions into SECURITY DEFINER disabled
inline-ing them, resulting in catastrophic degradation of the generated
plans, such that they took a lot longer than you were accustomed to
(they shouldn't have been "hung" though).
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, Kevin.Grittner@wicourts.gov
Subject: Re: Security definer "generated column" function used in index
In-Reply-To: <17366.1324417999@sss.pgh.pa.us>
References: <4EE203C20200002500043B7D@gw.wicourts.gov> <4EF09B4B0200002500043EA3@gw.wicourts.gov> <16831.1324416468@sss.pgh.pa.us> <4EF0AD530200002500043EBA@gw.wicourts.gov> <17366.1324417999@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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