pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: bajinsheng@u.nus.edu
Subject: BUG #18092: Unexpected Result by enable_seqscan
Date: Thu, 07 Sep 2023 05:52:59 +0000
Message-ID: <18092-642b3f34b38c08bc@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18092
Logged by:          Jinsheng Ba
Email address:      bajinsheng@u.nus.edu
PostgreSQL version: 15.4
Operating system:   Ubuntu
Description:        

The same query returns different results when enable_seqscan is changed:

CREATE TABLE t0(c0 FLOAT);
INSERT INTO t0(c0) VALUES(0.8);
CREATE VIEW v0(c0) AS (SELECT 1);
CREATE INDEX i0 ON t0(c0);
UNLISTEN *;
ANALYZE;
INSERT INTO t0(c0) VALUES(0.1);

SET enable_seqscan=on;
SELECT DISTINCT ON (v0.c0) t0.c0 FROM v0, t0; -- {0.8}
SET enable_seqscan=false;
SELECT DISTINCT ON (v0.c0) t0.c0 FROM v0, t0; -- {0.1}


Reproduction:
docker run -p 5432:5432 -e POSTGRES_PASSWORD=root -it postgres:latest 
psql "postgresql://postgres:root@localhost:5432"



view thread (3+ messages)  latest in thread

Message-ID: <18092-642b3f34b38c08bc@postgresql.org>
Permalink:  ../18092-642b3f34b38c08bc@postgresql.org/
Also on:    postgresql.org/message-id/18092-642b3f34b38c08bc@postgresql.org

 · 

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, bajinsheng@u.nus.edu
  Subject: Re: BUG #18092: Unexpected Result by enable_seqscan
  In-Reply-To: <18092-642b3f34b38c08bc@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