Re: Feature: temporary materialized views

Andreas Karlsson <andreas@proxel.se>

From: Andreas Karlsson <andreas@proxel.se>
To: Mitar <mmitar@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2019-01-21T02:46:05Z
Lists: pgsql-hackers
On 1/18/19 8:32 PM, Mitar wrote:
> On Fri, Jan 18, 2019 at 7:18 AM Andreas Karlsson <andreas@proxel.se> wrote:
>> These rules are usually pretty easy to add. Just take a look in
>> src/bin/psql/tab-complete.c to see how it is usually done.
> 
> Thanks. I have added the auto-complete and attached a new patch.

Hm, I do not think we should complete UNLOGGED MATERIALIZED VIEW even 
though it is valid syntax. If you try to create one you will just get an 
error. I am leaning towards removing the existing completion for this, 
because I do not see the point of completing to useless but technically 
valid syntax.

This is the one I think we should probably remove:

  	else if (TailMatches("CREATE", "UNLOGGED"))
  		COMPLETE_WITH("TABLE", "MATERIALIZED VIEW");

>> I might take a stab at refactoring this myself this weekend. Hopefully
>> it is not too involved.
> 
> That would be great! I can afterwards update the patch accordingly.

I have submitted a first shot at this. Let's see what others think of my 
patch.

Andreas


Commits

  1. Add more tests for CREATE TABLE AS with WITH NO DATA