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

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: 9.4 beta - pg_get_viewdef() and WITH CHECK OPTION
Date: 2014-05-18 23:10:53
Message-ID: CAEZATCUiPrBAcnjiQ5n8t2fz_A8Q-2fiKE1Z2zSDtTkS1Y=Whw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 17 May 2014 13:25, Thomas Kellerer <spam_eater(at)gmx(dot)net> wrote:
> Hello,
>
> 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.
>
> Is that intended (if so: why?) or is this an oversight/bug?
>

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+

Regards,
Dean

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2014-05-19 00:07:09 Re: materialised views vs unlogged table (also, ize vs ise)
Previous Message Vik Fearing 2014-05-18 22:32:00 Re: materialised views vs unlogged table (also, ize vs ise)