PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15657
PG Version11.1
OSMac OS 10.14.3
Opened2019-02-26 13:47:31+00
Reported byJames Stonehill
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15657
Logged by:          James Stonehill
Email address:      (redacted)
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.

Messages

DateAuthorSubject
2019-02-26 13:47:31+00PG Bug reporting formBUG #15657: `session_replication_role = replica` not respected by truncation