Re: 9.4 beta - pg_get_viewdef() and WITH CHECK OPTION

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Thomas Kellerer <spam_eater(at)gmx(dot)net>, pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: 9.4 beta - pg_get_viewdef() and WITH CHECK OPTION
Date: 2014-05-19 01:35:30
Message-ID: 29532.1400463330@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
> On 17 May 2014 13:25, Thomas Kellerer <spam_eater(at)gmx(dot)net> wrote:
>> when playing with 9.4 beta I noticed that the result of pg_get_viewdef()
>> will not include the new WITH CHECK OPTION clause when the view was created
>> using it.

> Yes, that's correct. pg_get_viewdef() only returns the underlying
> SELECT command for a view. This does not include any of the view's
> WITH parameters (check option and/or security barrier flag), because
> they aren't allowed in a SELECT statement.

> The additional parameters are held in pg_class.reloptions, and can be
> displayed from psql using \d+

I have to concur with the OP that this seems like a pretty darn weird
design choice. reloptions are for nonstandard PG-specific options, not
for SQL-spec-mandated syntax. What was the rationale for doing it like
that?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sandeep Gupta 2014-05-19 01:43:49 slow query question: more indexes considered harmful
Previous Message Fabrízio de Royes Mello 2014-05-19 01:05:02 Re: [GENERAL] Is it typo in pg_stat_replication column name in PG 9.4 ?