Re: ON SELECT rule on a table without columns

Поиск
Список
Период
Сортировка
От Ashutosh Sharma
Тема Re: ON SELECT rule on a table without columns
Дата
Msg-id CAE9k0Pk3a1vNEaR2V+6iOMLoKkR1p8x8v2X0jNJVVPgCp0Z6Wg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ON SELECT rule on a table without columns  (Andres Freund <andres@anarazel.de>)
Ответы Re: ON SELECT rule on a table without columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Thanks Andres for the quick review.

On Mon, Feb 11, 2019 at 3:52 PM Andres Freund <andres@anarazel.de> 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/regress/expected/create_view.out
> > +++ b/src/test/regress/expected/create_view.out
> > @@ -1706,9 +1706,16 @@ select pg_get_ruledef(oid, true) from pg_rewrite
> >       43 AS col_b;
> >  (1 row)
> >
> > +-- create view on a table without columns
> > +create table t0();
> > +create view v0 as select * from t0;
> > +select * from v0;
> > +--
> > +(0 rows)
>
> I suggest also adding a view that select zero columns, where the
> unerlying table has columns.
>

Done.

> I think it'd be good to name the view in a way that's a bit more unique,
> and leaving it in place. That way pg_dump can be tested with this too
> (and mostly would be tested via pg_upgrade's tests).
>

Renamed view to something like -> 'view_no_column' and
'view_zero_column' and didn't drop it so that it so that it gets
tested with pg_upgrade.

>
> >  -- clean up all the random objects we made above
> >  \set VERBOSITY terse \\ -- suppress cascade details
> >  DROP SCHEMA temp_view_test CASCADE;
> >  NOTICE:  drop cascades to 27 other objects
> >  DROP SCHEMA testviewschm2 CASCADE;
> > -NOTICE:  drop cascades to 62 other objects
> > +NOTICE:  drop cascades to 64 other objects
> > diff --git a/src/test/regress/expected/matview.out b/src/test/regress/expected/matview.out
> > index d0121a7..f1d24e6 100644
> > --- a/src/test/regress/expected/matview.out
> > +++ b/src/test/regress/expected/matview.out
> > @@ -589,3 +589,12 @@ SELECT * FROM mvtest2;
> >  ERROR:  materialized view "mvtest2" has not been populated
> >  HINT:  Use the REFRESH MATERIALIZED VIEW command.
> >  ROLLBACK;
> > +-- create materialized view on a table without columns
> > +create table mt0();
> > +create materialized view mv0 as select * from mt0;
> > +select * from mv0;
> > +--
> > +(0 rows)
>
> Same.
>
>

Done.

-- 
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: Why don't we have a small reserved OID range for patch revisions?
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: [PATCH v20] GSSAPI encryption support