Thread: 9.3 prepare plans - possible incompatibility

9.3 prepare plans - possible incompatibility

From
Pavel Stehule
Date:
Hello

I am not sure so replanning prepared plans due change of search_path is expected in all use cases. Minimally it should be mentioned as possible incompatibility.

Use case - move record from schema A to schema B with prepared statements

SET search_path = 'A';
PREPARE x(int) AS DELETE FROM tab WHERE id = $1 RETURNING *;

SET search_path = 'B';
PREPARE y(int, int) AS INSERT INTO tab VALUES($1, $2);

EXECUTE x;
EXECUTE y(10,20);

This use case will not work in 9.3.

Regards

Pavel