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: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: stepya@ukr.net
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15724: Can't create foreign table as partition
Date: Mon, 01 Apr 2019 15:57:29 +0900
Message-ID: <5CA1B659.1050908@lab.ntt.co.jp> (raw)
In-Reply-To: <038a0fec-6684-c654-bade-bcf80cb8daad@lab.ntt.co.jp>
References: <20190329141050.GA22336@alvherre.pgsql>
	<5CA1A320.4050707@lab.ntt.co.jp>
	<038a0fec-6684-c654-bade-bcf80cb8daad@lab.ntt.co.jp>

(2019/04/01 15:23), Amit Langote wrote:
> On 2019/04/01 14:35, Etsuro Fujita wrote:
>> (2019/03/29 23:10), Alvaro Herrera wrote:
>>> On 2019-Mar-29, Tom Lane wrote:
>>>
>>>> Alvaro Herrera<alvherre@2ndquadrant.com>   writes:
>>>>> On 2019-Mar-29, PG Bug reporting form wrote:
>>>>>> SQL Error [42809]: ERROR: cannot create index on foreign table
>>>>>> "msg_json"
>>
>>>> Really, what *ought* to happen in such a case is that the FDW gets
>>>> told about the command and has the opportunity to try to do something
>>>> corresponding to making an index.
>>
>> Interesting!
>
> +1
>
> Maybe, CHECK constraints on foreign tables are similar -- it merely
> asserts the condition that all of the rows in the remote table *must*
> satisfy so that the local server can do something useful with it, such as
> trying to exclude the table with constraint exclusion.
>
> I guess the intended benefit with allowing indexes would be similar -- a
> locally-defined index on a foreign table will help an FDW estimate the
> cost of a query accessing the table more efficiently than, for example,
> having to rely on some other relatively expensive alternative, such as
> use_remote_estimate in postgres_fdw's case.

Yeah, I think so.  Another benefit I can think of would be: that would 
probably allow us to support ON CONFLICT DO UPDATE for foreign tables. 
I think the intended benefit would be large!

Best regards,
Etsuro Fujita






view thread (23+ messages)  latest in thread

Message-ID: <5CA1B659.1050908@lab.ntt.co.jp>
Permalink:  ../5CA1B659.1050908@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/5CA1B659.1050908@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, Langote_Amit_f8@lab.ntt.co.jp, alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, stepya@ukr.net, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15724: Can't create foreign table as partition
  In-Reply-To: <5CA1B659.1050908@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