| From: | PG Bug reporting form <noreply(at)postgresql(dot)org> | 
|---|---|
| To: | pgsql-bugs(at)lists(dot)postgresql(dot)org | 
| Cc: | 82820676(at)qq(dot)com | 
| Subject: | BUG #16102: Table can't be drop on PostgreSQL 10.09 if the table was created from PostgreSQL 10.10 | 
| Date: | 2019-11-08 09:28:55 | 
| Message-ID: | 16102-3fe2c9426d7faba1@postgresql.org | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-bugs | 
The following bug has been logged on the website:
Bug reference:      16102
Logged by:          Fan Liu
Email address:      82820676(at)qq(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tomas Vondra | 2019-11-08 11:13:39 | Re: BUG #16101: tables in the DB is not available after pg_restore | 
| Previous Message | PG Bug reporting form | 2019-11-08 07:37:24 | BUG #16101: tables in the DB is not available after pg_restore |