Re: BUG #18556: Parallel operation error during CREATE TABLE AS statement

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: shaun(at)tembo(dot)io
Subject: Re: BUG #18556: Parallel operation error during CREATE TABLE AS statement
Date: 2024-07-31 11:11:06
Message-ID: CAJ7c6TOwU4jOjNBW=HneSZ6eW30cCnzMAoTaUYEFyJ6nO5cKiw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

> We have been witnessing an intermittent error from a Postgres 16.3 instance
> if a table is created using a SELECT statement. The error is:
>
> ERROR: cannot start commands during a parallel operation
>
> [...]

I tried to reproduce the issue on debug and release builds of
PostgreSQL `master` and `REL_16_STABLE` on different hardware and
didn't succeed so far.

Here are the queries I used:

```
CREATE TABLE IF NOT EXISTS phonebook(
id SERIAL PRIMARY KEY,
name TEXT,
phone BIGINT);

INSERT INTO phonebook
SELECT i, 'name_' || i, i # 0xDEADBEEF
FROM generate_series(1, 54_000_000) AS i;

SET parallel_tuple_cost = 0;

-- execute several times:
-- make sure Parallel Seq Scan is used with EXPLAIN ANALYZE
CREATE [TEMP] TABLE pb_subset AS (
SELECT id, name
FROM phonebook
WHERE phone > [choose a number]
);
```

If you could provide minimal steps that reproduce the issue on your
hardware this would be helpful. Please let us know whether the issue
reproduces on PostgreSQL 17 beta, or only on 16.3. Also please give us
a little more details about the hardware.

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Aleksander Alekseev 2024-07-31 11:50:23 Re: Inconsistency of timezones in postgresql
Previous Message Chris BSomething 2024-07-31 10:55:50 Inconsistency of timezones in postgresql