BUG #15657: `session_replication_role = replica` not respected by truncation

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #15657: `session_replication_role = replica` not respected by truncation
Дата
Msg-id 15657-f94bb6e3ad28e1e2@postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15657
Logged by:          James Stonehill
Email address:      jamesstonehill@gmail.com
PostgreSQL version: 11.1
Operating system:   Mac OS 10.14.3
Description:

Truncation does not ignore foreign key triggers when the
session_replication_role is set to "replica" like DELETE does.

```
CREATE TABLE users (
    id serial PRIMARY KEY
);

CREATE TABLE posts(
    id serial PRIMARY KEY,
    user_id INTEGER REFERENCES users(id)
);

INSERT INTO users(id) VALUES (1);
INSERT INTO posts(id, user_id) VALUES (1, 1);

SET session_replication_role = replica;

TRUNCATE users;
```
returns
> ERROR:  cannot truncate a table referenced in a foreign key constraint
> DETAIL:  Table "posts" references "users".
> HINT:  Truncate table "posts" at the same time, or use TRUNCATE ...
CASCADE.


В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15656: Not able to login database
Следующее
От: Sandeep Thakkar
Дата:
Сообщение: Re: BUG #15647: pgagent file missing