Re: psql :: support for \ev viewname and \sv viewname

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Petr Korobeinikov <pkorobeinikov@gmail.com>, Jeevan Chalke <jeevan.chalke@enterprisedb.com>, Jeevan Chalke <jeevan.chalke@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2016-04-27T07:36:10Z
Lists: pgsql-hackers

Attachments

[Looking back over old threads]

On 22 July 2015 at 22:00, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> This appears to be missing support for view options (WITH CHECK OPTION
> and security_barrier), so editing a view with either of those options
> will cause them to be stripped off.

It seems like this issue was never addressed, and it needs to be fixed for 9.6.

Here is a rough patch based on the way pg_dump handles this. It still
needs a bit of polishing -- in particular I think fmtReloptionsArray()
(copied from pg_dump) should probably be moved to string_utils.c so
that it can be shared between pg_dump and psql. Also, I'm not sure
that's the best name for it -- I think appendReloptionsArray() is a
more accurate description of what is does.

Regards,
Dean

Commits

  1. Fix psql's \ev and \sv commands so that they handle view reloptions.

  2. Move and rename fmtReloptionsArray().

  3. pgindent run for 9.5