ALTER FOREIGN DATA WRAPPER can drop dependency on handler

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: ALTER FOREIGN DATA WRAPPER can drop dependency on handler
Date: 2026-03-18 19:09:54
Message-ID: 35c44a4b7fb76d35418c4d66b775a88f4ce60c86.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


CREATE FUNCTION test_fdw_handler()
RETURNS fdw_handler
AS :'regresslib', 'test_fdw_handler'
LANGUAGE C;

CREATE FOREIGN DATA WRAPPER test_fdw HANDLER test_fdw_handler;

-- correctly raises dependency ERROR
DROP FUNCTION test_fdw_handler;

ALTER FOREIGN DATA WRAPPER test_fdw VALIDATOR postgresql_fdw_validator;

-- fails to raise dependency error ERROR
DROP FUNCTION test_fdw_handler;

Patch attached.

Note: I found this while investigating a related issue for the FDW
connection function, with patch here:

https://www.postgresql.org/message-id/fd49b44dc65da8e71ab20c1cf1ec7e65921c20f5.camel@j-davis.com

I am keeping this patch separate for a clean backport.

Regards,
Jeff Davis

Attachment Content-Type Size
v1-0001-Fix-dependency-on-FDW-handler.patch text/x-patch 935 bytes

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Nathan Bossart 2026-03-18 19:29:58 Re: ALTER FOREIGN DATA WRAPPER can drop dependency on handler
Previous Message Tom Lane 2026-03-18 17:58:55 Re: Revoke Connect Privilege from Database not working