Re: ON SELECT rule on a table without columns

2019-02-17 Thread Ashutosh Sharma
On Sun, Feb 17, 2019 at 11:10 PM Tom Lane wrote: > > Ashutosh Sharma writes: > > [ allow-create-view-on-table-without-columns-v3.patch ] > > Pushed. I revised the test cases a bit --- notably, I wanted to be > sure we exercised pg_dump's createDummyViewAsClause for this, especially > after notic

Re: ON SELECT rule on a table without columns

2019-02-17 Thread Tom Lane
Ashutosh Sharma writes: > [ allow-create-view-on-table-without-columns-v3.patch ] Pushed. I revised the test cases a bit --- notably, I wanted to be sure we exercised pg_dump's createDummyViewAsClause for this, especially after noticing that it wasn't being tested at all before :-(

Re: ON SELECT rule on a table without columns

2019-02-11 Thread Ashutosh Sharma
Thanks Andres for the quick review. On Mon, Feb 11, 2019 at 3:52 PM Andres Freund wrote: > > Hi, > > On 2019-02-11 15:39:03 +0530, Ashutosh Sharma wrote: > > Andres, Tom, Please have a look into the attached patch and let me > > know if I'm still missing something. Thank you. > > > --- a/src/test

Re: ON SELECT rule on a table without columns

2019-02-11 Thread Andres Freund
Hi, On 2019-02-11 15:39:03 +0530, Ashutosh Sharma wrote: > Andres, Tom, Please have a look into the attached patch and let me > know if I'm still missing something. Thank you. > --- a/src/test/regress/expected/create_view.out > +++ b/src/test/regress/expected/create_view.out > @@ -1706,9 +1706,16

Re: ON SELECT rule on a table without columns

2019-02-11 Thread Ashutosh Sharma
On Sat, Feb 9, 2019 at 12:20 AM Ashutosh Sharma wrote: > > On Fri, Feb 8, 2019 at 11:32 PM Tom Lane wrote: > > > > Ashutosh Sharma writes: > > > Attached is the patch that allows us to create view on a table without > > > columns. I've also added some test-cases for it in create_view.sql. > > >

Re: ON SELECT rule on a table without columns

2019-02-08 Thread Ashutosh Sharma
On Fri, Feb 8, 2019 at 11:32 PM Tom Lane wrote: > > Ashutosh Sharma writes: > > Attached is the patch that allows us to create view on a table without > > columns. I've also added some test-cases for it in create_view.sql. > > Please have a look and let me know your opinion. > > Haven't read the

Re: ON SELECT rule on a table without columns

2019-02-08 Thread Tom Lane
Ashutosh Sharma writes: > Attached is the patch that allows us to create view on a table without > columns. I've also added some test-cases for it in create_view.sql. > Please have a look and let me know your opinion. Haven't read the patch, but a question seems in order here: should we regard th

Re: ON SELECT rule on a table without columns

2019-02-08 Thread Ashutosh Sharma
On Fri, Feb 8, 2019 at 7:55 PM Tom Lane wrote: > > Andres Freund writes: > > You misunderstood my point: I'm asking why we shouldn't remove that check > > from views, rather than adding it to create rule. > > +1. This seems pretty obviously to be something we just missed when > we changed thing

Re: ON SELECT rule on a table without columns

2019-02-08 Thread Tom Lane
Andres Freund writes: > You misunderstood my point: I'm asking why we shouldn't remove that check > from views, rather than adding it to create rule. +1. This seems pretty obviously to be something we just missed when we changed things to allow zero-column tables. regar

Re: ON SELECT rule on a table without columns

2019-02-08 Thread Ashutosh Sharma
On Fri, Feb 8, 2019 at 3:05 PM Andres Freund wrote: > > > > On February 8, 2019 10:05:03 AM GMT+01:00, Rushabh Lathia > wrote: > >On Fri, Feb 8, 2019 at 12:48 PM Andres Freund > >wrote: > > > >> Hi, > >> > >> On 2019-02-08 12:18:32 +0530, Ashutosh Sharma wrote: > >> > When "ON SELECT" rule is c

Re: ON SELECT rule on a table without columns

2019-02-08 Thread Andres Freund
On February 8, 2019 10:05:03 AM GMT+01:00, Rushabh Lathia wrote: >On Fri, Feb 8, 2019 at 12:48 PM Andres Freund >wrote: > >> Hi, >> >> On 2019-02-08 12:18:32 +0530, Ashutosh Sharma wrote: >> > When "ON SELECT" rule is created on a table without columns, it >> > successfully converts a table i

Re: ON SELECT rule on a table without columns

2019-02-08 Thread Ashutosh Sharma
On Fri, Feb 8, 2019 at 12:48 PM Andres Freund wrote: > > Hi, > > On 2019-02-08 12:18:32 +0530, Ashutosh Sharma wrote: > > When "ON SELECT" rule is created on a table without columns, it > > successfully converts a table into the view. However, when the same is > > done using CREATE VIEW command, i

Re: ON SELECT rule on a table without columns

2019-02-08 Thread Rushabh Lathia
On Fri, Feb 8, 2019 at 12:48 PM Andres Freund wrote: > Hi, > > On 2019-02-08 12:18:32 +0530, Ashutosh Sharma wrote: > > When "ON SELECT" rule is created on a table without columns, it > > successfully converts a table into the view. However, when the same is > > done using CREATE VIEW command, it

Re: ON SELECT rule on a table without columns

2019-02-07 Thread Andres Freund
Hi, On 2019-02-08 12:18:32 +0530, Ashutosh Sharma wrote: > When "ON SELECT" rule is created on a table without columns, it > successfully converts a table into the view. However, when the same is > done using CREATE VIEW command, it fails with an error saying: "view > must have at least one column

Re: ON SELECT rule on a table without columns

2019-02-07 Thread Rushabh Lathia
On Fri, Feb 8, 2019 at 12:18 PM Ashutosh Sharma wrote: > Hi All, > > When "ON SELECT" rule is created on a table without columns, it > successfully converts a table into the view. However, when the same is > done using CREATE VIEW command, it fails with an error saying: "view > must have at least