1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Support "COPY view FROM" for views with INSTEAD OF INSERT triggers.

We just pass the data to the INSTEAD trigger.

Haribabu Kommi, reviewed by Dilip Kumar

Patch: <CAJrrPGcSQkrNkO+4PhLm4B8UQQQmU9YVUuqmtgM=pmzMfxWaWQ@mail.gmail.com>
This commit is contained in:
Tom Lane
2016-11-10 14:13:43 -05:00
parent e1b449bea9
commit 279c439c7f
4 changed files with 125 additions and 44 deletions

View File

@ -395,9 +395,15 @@ COPY <replaceable class="parameter">count</replaceable>
<title>Notes</title>
<para>
<command>COPY</command> can only be used with plain tables, not
<command>COPY TO</command> can only be used with plain tables, not
with views. However, you can write <literal>COPY (SELECT * FROM
<replaceable class="parameter">viewname</replaceable>) TO ...</literal>.
<replaceable class="parameter">viewname</replaceable>) TO ...</literal>
to copy the current contents of a view.
</para>
<para>
<command>COPY FROM</command> can be used with plain tables and with views
that have <literal>INSTEAD OF INSERT</> triggers.
</para>
<para>