From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: 82820676@qq.com
Subject: BUG #16102: Table can't be drop on PostgreSQL 10.09 if the table was created from PostgreSQL 10.10
Date: Fri, 08 Nov 2019 09:28:55 +0000
Message-ID: <16102-3fe2c9426d7faba1@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 16102
Logged by: Fan Liu
Email address: 82820676@qq.com
PostgreSQL version: 10.10
Operating system: suse
Description:
Hi,
Have anyone meet table can't be drop on PostgreSQL 10.09 if the table was
created from PostgreSQL 10.10?
1) On v10.10, create table 'pgbench_accounts' with below script
-----------script-------------
DROP TABLE IF EXISTS pgbench_accounts;
CREATE TABLE pgbench_accounts (
aid int not null,
bid int,
abalance int,
filler char(84)
)
PARTITION BY RANGE (aid);
CREATE FUNCTION __create_partitions__(count INTEGER, number INTEGER DEFAULT
1000000)
RETURNS VOID AS
$$
DECLARE
i int;
partition_size int := number / count;
BEGIN
FOR i IN SELECT generate_series(1, count)
LOOP
EXECUTE format('CREATE TABLE pgbench_accounts_%s PARTITION OF
pgbench_accounts
FOR VALUES FROM (%s) TO (%s)',
i,
(i - 1) * partition_size + 1,
i * partition_size + 1);
END LOOP;
END
$$
LANGUAGE plpgsql;
SELECT __create_partitions__(:pcount, :num);
DROP FUNCTION __create_partitions__(INTEGER,INTEGER);
INSERT INTO pgbench_accounts (aid, bid, abalance) SELECT generate_series(1,
:num), 1, 0;
-----------script end-------------
2) Remove v10.10 and use v10.09 start with same storage (our downgrade test
on K8s, storage are decouple with application )
3) Then we execute same script on v10.09, we find that drop table has no
error, but the table still there.
4) another table pgbench_accounts_1 can be drop and no issue found.
postgres=# DROP TABLE pgbench_accounts;
DROP TABLE
postgres=# \dt
List of relations
Schema | Name | Type | Owner
----------+--------------------+-------+----------
public | geometries | table | postgres
public | pgbench_accounts | table | postgres
public | pgbench_accounts_1 | table | postgres
public | spatial_ref_sys | table | postgres
topology | layer | table | postgres
topology | topology | table | postgres
(6 rows)
BRs,
Fan Liu
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, 82820676@qq.com
Subject: Re: BUG #16102: Table can't be drop on PostgreSQL 10.09 if the table was created from PostgreSQL 10.10
In-Reply-To: <16102-3fe2c9426d7faba1@postgresql.org>
References: <16102-3fe2c9426d7faba1@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