PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15352
PG Version9.6.8
OSLinux
Opened2018-08-25 08:03:22+00
Reported byMaksym Boguk
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15352
Logged by:          Maksym Boguk
Email address:      (redacted)
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

Messages

DateAuthorSubject
2018-08-25 08:03:22+00=?utf-8?q?PG_Bug_reporting_form?=BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
2018-08-25 08:50:13+00Andrew GierthRe: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
2018-08-25 17:12:58+00Andrew GierthRe: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
2018-08-28 14:23:20+00Andrew GierthRe: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
2018-08-29 08:55:06+00Ashutosh BapatRe: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
2018-08-29 11:02:46+00Andrew GierthRe: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
2018-08-30 05:37:28+00Ashutosh BapatRe: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
2018-08-30 08:44:34+00Andrew GierthRe: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
2018-08-31 06:28:26+00Ashutosh BapatRe: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"
2018-08-31 09:51:00+00Andrew GierthRe: BUG #15352: postgresql FDW error "ERROR: ORDER BY position 0 is not in select list"