public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tomas Vondra <[email protected]>
To: Tom Lane <[email protected]>
Cc: James Finnerty <[email protected]>
Cc: [email protected]
Subject: Re: postgres_fdw: using TABLESAMPLE to collect remote sample
Date: Sun, 1 Jan 2023 23:36:49 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<167112207543.1120.12195641719862911275.pgcf@coridan.postgresql.org>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

On 12/31/22 18:23, Tom Lane wrote:
> Tomas Vondra <[email protected]> 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.
> 

Yeah, it's a weird use case. I can't quite imagine why would anyone do
that, but I guess the mere possibility is sufficient reason to add the
relkind check ...


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






view thread (3+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: postgres_fdw: using TABLESAMPLE to collect remote sample
  In-Reply-To: <[email protected]>

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

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