From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: maxim.boguk@gmail.com
Subject: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
Date: Sat, 25 Aug 2018 08:03:22 +0000
Message-ID: <153518420278.1478.14875560810251994661@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15352
Logged by: Maksym Boguk
Email address: maxim.boguk@gmail.com
PostgreSQL version: 9.6.8
Operating system: Linux
Description:
Hi,
I found strange error with postgresql_fdw used with use_remote_estimate
'true'.
Trimmed test case:
\с postgres
create extension postgres_fdw;
CREATE SERVER test FOREIGN DATA WRAPPER postgres_fdw OPTIONS (
dbname 'postgres',
use_remote_estimate 'true'
);
CREATE USER MAPPING FOR public SERVER test OPTIONS (
"user" 'postgres'
);
IMPORT FOREIGN SCHEMA pg_catalog
LIMIT TO (pg_stat_user_tables)
FROM SERVER test
INTO public;
select *
from pg_catalog.pg_stat_user_tables
join public.pg_stat_user_tables USING (relid)
WHERE
greatest(pg_catalog.pg_stat_user_tables.idx_scan,
public.pg_stat_user_tables.idx_scan)=0;
ERROR: ORDER BY position 0 is not in select list
CONTEXT: Remote SQL command: EXPLAIN SELECT relid, schemaname, relname,
seq_scan, seq_tup_read, idx_scan, idx_tup_fetch, n_tup_ins, n_tup_upd,
n_tup_del, n_tup_hot_upd, n_live_tup, n_dead_tup, n_mod_since_analyze,
last_vacuum, last_autovacuum, last_analyze, last_autoanalyze, vacuum_count,
autovacuum_count, analyze_count, autoanalyze_count FROM
pg_catalog.pg_stat_user_tables ORDER BY 0 ASC NULLS LAST
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, maxim.boguk@gmail.com
Subject: Re: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
In-Reply-To: <153518420278.1478.14875560810251994661@wrigleys.postgresql.org>
References: <153518420278.1478.14875560810251994661@wrigleys.postgresql.org>
* 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