pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: Stepan Yankevych <stepya@ukr.net>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15724: Can't create foreign table as partition
Date: Mon, 01 Apr 2019 15:01:50 +0900
Message-ID: <5CA1A94E.1070002@lab.ntt.co.jp> (raw)
In-Reply-To: <1553869152.858391073.5f8m3n0x@frv53.fwdcdn.com>
References: <21389.1553868091@sss.pgh.pa.us>
	<20190329141050.GA22336@alvherre.pgsql>
	<1553869152.858391073.5f8m3n0x@frv53.fwdcdn.com>

(2019/03/29 23:21), Stepan Yankevych wrote:
> I think we need at least to mention it in the doc
> https://www.postgresql.org/docs/11/ddl-partitioning.html
>
>> > Partitions can also be foreign tables, although they have some
> limitations that normal tables do not; see CREATE FOREIGN TABLE
> <https://www.postgresql.org/docs/11/sql-createforeigntable.html>for more
> information
> For example
> Partitions can also be foreign tables*only in case main table is non
> indexed and doesn't contain PK,*although they have some limitations that
> normal tables do not; see CREATE FOREIGN TABLE
> <https://www.postgresql.org/docs/11/sql-createforeigntable.html>for more
> information

+1 for adding such notes, but I'm not sure if it's a good idea to put it 
there because I think that would make the introductory documentation a 
bit verbose.  How about adding it to the reference pages of CREATE 
FOREIGN TABLE and ALTER TABLE like the attached?

Best regards,
Etsuro Fujita

Attachments:

  [text/x-patch] doc-foreign-partition.patch (1.4K, ../5CA1A94E.1070002@lab.ntt.co.jp/2-doc-foreign-partition.patch)
  download | inline diff:
*** a/doc/src/sgml/ref/alter_table.sgml
--- b/doc/src/sgml/ref/alter_table.sgml
***************
*** 842,847 **** WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
--- 842,851 ----
        one will be created in the attached table; or, if an equivalent
        index already exists, will be attached to the target table's index,
        as if <command>ALTER INDEX ATTACH PARTITION</command> had been executed.
+       Note that if the existing table is a foreign table, it is currently not
+       allowed to attach the table as a partition of the target table if there
+       are indexes on the target table.  (See also
+       <xref linkend="sql-createtable"/>.)
       </para>
  
       <para>
*** a/doc/src/sgml/ref/create_foreign_table.sgml
--- b/doc/src/sgml/ref/create_foreign_table.sgml
***************
*** 169,174 **** CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ]
--- 169,178 ----
        the given parent table with specified partition bound values.
        See the similar form of
        <xref linkend="sql-createtable"/> for more details.
+       Note that it is currently not allowed to create the foreign table as a
+       partition of the parent table if there are indexes on the parent table.
+       (See also
+       <link linkend="sql-altertable"><command>ALTER TABLE ATTACH PARTITION</command></link>.)
       </para>
      </listitem>
     </varlistentry>

view thread (23+ messages)  latest in thread

Message-ID: <5CA1A94E.1070002@lab.ntt.co.jp>
Permalink:  ../5CA1A94E.1070002@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/5CA1A94E.1070002@lab.ntt.co.jp

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: fujita.etsuro@lab.ntt.co.jp, stepya@ukr.net, alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15724: Can't create foreign table as partition
  In-Reply-To: <5CA1A94E.1070002@lab.ntt.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox