BUG #18410: SQL Error [XX000]: ERROR: variable not found in subplan target list

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: fernando(dot)asulay(at)es(dot)abb(dot)com
Subject: BUG #18410: SQL Error [XX000]: ERROR: variable not found in subplan target list
Date: 2024-03-27 12:42:33
Message-ID: 18410-b6ad04652311ce33@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18410
Logged by: Fernando Asulay
Email address: fernando(dot)asulay(at)es(dot)abb(dot)com
PostgreSQL version: 16.2
Operating system: TimescaleDB linux Docker image
Description:

The issue was found to happend on timescaledb extension hypertables using
postgres 14 and above. We tested different version of timescaledb and
doesn't seem to take any effect. Only changing pg version from 13 to 14.

Tested using images from
https://hub.docker.com/r/timescale/timescaledb/tags

To reproduce the error:

The following compose was used:

version: "3.5"
services:
works:
image: timescale/timescaledb:2.14.2-pg13
container_name: works
restart: always
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
ports:
- "5432:5432"

doesntwork:
image: timescale/timescaledb:2.14.2-pg14
container_name: doesntwork
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
ports:
- "5433:5432"

doesntworkeither:
image: timescale/timescaledb:2.14.2-pg16
container_name: doesntworkeither
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
ports:
- "5434:5432"

connect to "doesntwork" or "doesntworkeither" containers and run the
following SQL:

-- Create test table
CREATE TABLE public.test1(
id text NOT null,
created timestamptz NOT NULL
);
-- Make the table an timescaledb hypertable
SELECT create_hypertable('public.test1', 'created', chunk_time_interval =>
interval'4 days');
-- Insert some data
INSERT INTO public.test1 VALUES (1, '2024-01-01');
-- Verify data is correclty inserted
SELECT * FROM public.test1;
-- Run the query to trigger the error
DELETE FROM
"public".test1
WHERE
(EXISTS (SELECT 1));

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurenz Albe 2024-03-27 13:01:58 Re: BUG #18410: SQL Error [XX000]: ERROR: variable not found in subplan target list
Previous Message Hayato Kuroda (Fujitsu) 2024-03-27 10:37:02 RE: Potential data loss due to race condition during logical replication slot creation