postgresql/src/backend/commands
Tom Lane a32ca78836 Fix CREATE VIEW to allow zero-column views.
We should logically have allowed this case when we allowed zero-column
tables, but it was overlooked.

Although this might be thought a feature addition, it's really a bug
fix, because it was possible to create a zero-column view via
the convert-table-to-view code path, and then you'd have a situation
where dump/reload would fail.  Hence, back-patch to all supported
branches.

Arrange the added test cases to provide coverage of the related
pg_dump code paths (since these views will be dumped and reloaded
during the pg_upgrade regression test).  I also made them test
the case where pg_dump has to postpone the view rule into post-data,
which disturbingly had no regression coverage before.

Report and patch by Ashutosh Sharma (test case by me)

Discussion: https://postgr.es/m/CAE9k0PkmHdeSaeZt2ujnb_cKucmK3sDDceDzw7+d5UZoNJPYOg@mail.gmail.com
2019-02-17 12:37:31 -05:00
..
aggregatecmds.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
alter.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
amcmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
analyze.c Move remaining code from tqual.[ch] to heapam.h / heapam_visibility.c. 2019-01-21 17:07:10 -08:00
async.c Move remaining code from tqual.[ch] to heapam.h / heapam_visibility.c. 2019-01-21 17:07:10 -08:00
cluster.c Refactor planner's header files. 2019-01-29 15:48:51 -05:00
collationcmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
comment.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
constraint.c Move generic snapshot related code from tqual.h to snapmgr.h. 2019-01-21 17:06:41 -08:00
conversioncmds.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
copy.c Refactor planner's header files. 2019-01-29 15:48:51 -05:00
createas.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
dbcommands.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
define.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
discard.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
dropcmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
event_trigger.c Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
explain.c Refactor planner's header files. 2019-01-29 15:48:51 -05:00
extension.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
foreigncmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
functioncmds.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
indexcmds.c Redesign the partition dependency mechanism. 2019-02-11 14:41:17 -05:00
lockcmds.c Adjust gratuitously different error message wording 2019-02-11 14:01:05 +01:00
Makefile Move vacuumlazy.c into access/heap. 2019-01-15 12:06:19 -08:00
matview.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
opclasscmds.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
operatorcmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
policy.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
portalcmds.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
prepare.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
proclang.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
publicationcmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
schemacmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
seclabel.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
sequence.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
statscmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
subscriptioncmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
tablecmds.c Redesign the partition dependency mechanism. 2019-02-11 14:41:17 -05:00
tablespace.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
trigger.c Redesign the partition dependency mechanism. 2019-02-11 14:41:17 -05:00
tsearchcmds.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
typecmds.c Create the infrastructure for planner support functions. 2019-02-09 18:08:48 -05:00
user.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
vacuum.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
variable.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
view.c Fix CREATE VIEW to allow zero-column views. 2019-02-17 12:37:31 -05:00