Re: postgres_fdw: using TABLESAMPLE to collect remote sample

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: James Finnerty <jfinnert(at)amazon(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: postgres_fdw: using TABLESAMPLE to collect remote sample
Date: 2022-12-31 17:23:51
Message-ID: 1040922.1672507431@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com> writes:
> On 12/31/22 05:42, Tom Lane wrote:
>> ERROR: TABLESAMPLE clause can only be applied to tables and materialized views
>> I think the patch avoids that, but only accidentally, because
>> reltuples will be 0 or -1 for a view. Maybe it'd be a good
>> idea to pull back relkind along with reltuples, and check
>> that too?

> Not sure. I guess we can rely on reltuples being 0 or -1 in such cases,
> but maybe it'd be good to at least mention that in a comment? We're not
> going to use other reltuples values for views etc.

Would anyone ever point a foreign table at a sequence? I guess it
would be a weird use-case, but it's possible, or was till now.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-12-31 18:02:31 Re: Request for removal of BUG #5705 from todo items as no repro
Previous Message Andrew Dunstan 2022-12-31 15:02:32 Announcing Release 15 of the PostgreSQL Buildfarm client