From: | zhxpgh <zhxpgh(at)foxmail(dot)com> |
---|---|
To: | pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
Subject: | two bugs |
Date: | 2023-02-25 01:43:22 |
Message-ID: | tencent_7294503D958856DB8D18599B2CF2C0AA4406@qq.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The first:
zhxp(at)THINKPAD-E14:~/repositories/postgres/postgres$ psql
psql (12.14)
Type "help" for help.
postgres=# create table trigtest(i serial primary key);
CREATE TABLE
postgres=# create table trigtestfk(i int references trigtest(i) on delete cascade);
CREATE TABLE
postgres=# insert into trigtest default values;
INSERT 0 1
postgres=# insert into trigtest default values;
INSERT 0 1
postgres=# insert into trigtest default values;
INSERT 0 1
postgres=# select * from trigtest;
i
---
1
2
3
(3 rows)
postgres=# insert into trigtestfk values (1);
INSERT 0 1
postgres=# alter table trigtest disable trigger all;
ALTER TABLE
postgres=# delete from trigtest where i = 1;
DELETE 1
postgres=# select * from trigtest;
i
---
2
3
(2 rows)
postgres=# select * from trigtestfk;
i
---
1
(1 row)
postgres=# \q
zhxp(at)THINKPAD-E14:~/release/pg$ bin/pg_dump > trigtets.sql
zhxp(at)THINKPAD-E14:~/release/pg$ bin/createdb trigtest
zhxp(at)THINKPAD-E14:~/release/pg$ psql trigtest
psql (12.14)
Type "help" for help.
trigtest=# \i /home/zhxp/release/pg/trigtets.sql
SET
SET
SET
SET
SET
set_config
------------
(1 row)
SET
SET
SET
SET
SET
SET
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
ALTER TABLE
COPY 2
COPY 1
setval
--------
4
(1 row)
ALTER TABLE
psql:/home/zhxp/release/pg/trigtets.sql:113: ERROR: insert or update on table "trigtestfk" violates foreign key constraint "trigtestfk_i_fkey"
DETAIL: Key (i)=(1) is not present in table "trigtest".
trigtest=#
and the second:
zhxp(at)THINKPAD-E14:~/release/pg$ psql
psql (12.14)
Type "help" for help.
postgres=# create table t1(i int);
CREATE TABLE
postgres=# insert into t1 values (1);
INSERT 0 1
postgres=# create materialized view mv_t1 as select * from t1;
SELECT 1
postgres=# create unique index on mv_t1(i);
CREATE INDEX
postgres=# insert into t1 values (1);
INSERT 0 1
postgres=# select * from t1;
i
---
1
1
(2 rows)
postgres=# select * from mv_t1;
i
---
1
(1 row)
postgres=# \q
zhxp(at)THINKPAD-E14:~/release/pg$ bin/pg_dump > mvtest.sql
zhxp(at)THINKPAD-E14:~/release/pg$ bin/createdb mvtest
zhxp(at)THINKPAD-E14:~/release/pg$ psql mvtest
psql (12.14)
Type "help" for help.
mvtest=# \i /home/zhxp/release/pg/mvtest.sql
SET
SET
SET
SET
SET
set_config
------------
(1 row)
SET
SET
SET
SET
SET
SET
CREATE TABLE
ALTER TABLE
CREATE MATERIALIZED VIEW
ALTER TABLE
COPY 2
CREATE INDEX
psql:/home/zhxp/release/pg/mvtest.sql:67: ERROR: could not create unique index "mv_t1_i_idx"
DETAIL: Key (i)=(1) is duplicated.
mvtest=#
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2023-02-25 03:39:11 | Re: BUG #17744: Fail Assert while recoverying from pg_basebackup |
Previous Message | Andres Freund | 2023-02-24 23:57:04 | Re: BUG #17800: ON CONFLICT DO UPDATE fails to detect incompatible fields that leads to a server crash |