ODBC fails to recognize event trigger removal
Hi, ALL,
[code]
postgres=# CREATE OR REPLACE FUNCTION __watch_schema_changes() RETURNS
event_trigger LANGUAGE plpgsql AS $$ BEGIN NOTIFY tg_tag; END; $$;
CREATE FUNCTION
postgres=# CREATE EVENT TRIGGER schema_change_notify ON
ddl_command_end WHEN TAG IN('CREATE TABLE', 'ALTER TABLE', 'DROP
TABLE', 'CREATE INDEX', 'DROP INDEX') EXECUTE PROCEDURE
__watch_schema_changes();
CREATE EVENT TRIGGER
postgres=# DROP EVENT TRIGGER schema_change_notify CASCADE;
DROP EVENT TRIGGER
postgres=# \q
igor@WaylandGnome ~/unixODBC-2.3.12 $ isql postgres postgres wasqra123
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| echo [string] |
| quit |
| |
+---------------------------------------+
SQL> CREATE OR REPLACE FUNCTION __watch_schema_changes() RETURNS
event_trigger LANGUAGE plpgsql AS $$ BEGIN NOTIFY tg_tag; END; $$;
SQLRowCount returns -1
SQL> CREATE EVENT TRIGGER schema_change_notify ON ddl_command_end WHEN
TAG IN('CREATE TABLE', 'ALTER TABLE', 'DROP TABLE', 'CREATE INDEX',
'DROP INDEX') EXECUTE PROCEDURE __watch_schema_changes();
[ISQL]ERROR: Could not SQLExecute
SQL> quit
igor@WaylandGnome ~/unixODBC-2.3.12 $
[/code]
Server version 16.2
Driver version 11.1
Anybody aware of this?
Thank you.
On 11/23/25 04:44, Igor Korot wrote:
Hi, ALL,
[code] postgres=# CREATE OR REPLACE FUNCTION __watch_schema_changes() RETURNS event_trigger LANGUAGE plpgsql AS $$ BEGIN NOTIFY tg_tag; END; $$; CREATE FUNCTION postgres=# CREATE EVENT TRIGGER schema_change_notify ON ddl_command_end WHEN TAG IN('CREATE TABLE', 'ALTER TABLE', 'DROP TABLE', 'CREATE INDEX', 'DROP INDEX') EXECUTE PROCEDURE __watch_schema_changes(); CREATE EVENT TRIGGER postgres=# DROP EVENT TRIGGER schema_change_notify CASCADE; DROP EVENT TRIGGER postgres=# \q igor@WaylandGnome ~/unixODBC-2.3.12 $ isql postgres postgres wasqra123 +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | echo [string] | | quit | | | +---------------------------------------+ SQL> CREATE OR REPLACE FUNCTION __watch_schema_changes() RETURNS event_trigger LANGUAGE plpgsql AS $$ BEGIN NOTIFY tg_tag; END; $$; SQLRowCount returns -1 SQL> CREATE EVENT TRIGGER schema_change_notify ON ddl_command_end WHEN TAG IN('CREATE TABLE', 'ALTER TABLE', 'DROP TABLE', 'CREATE INDEX', 'DROP INDEX') EXECUTE PROCEDURE __watch_schema_changes(); [ISQL]ERROR: Could not SQLExecute SQL> quit igor@WaylandGnome ~/unixODBC-2.3.12 $ [/code]Server version 16.2
Driver version 11.1Anybody aware of this?
1) There is a Postgres list dedicated to the ODBC driver:
https://www.postgresql.org/list/pgsql-odbc/
You should probably ask these sort of questions there.
2) I have to believe the below is the issue:
Server version 16.2
Driver version 11.1
Given that the most recent current driver is REL-17_00_0006 and from here:
https://github.com/postgresql-interfaces/psqlodbc/tree/REL-11_01_0000
The 11.1 driver was released 6 years ago which predates the release of
Postgres 16 by ~4.5 years.
Thank you.
--
Adrian Klaver
adrian.klaver@aklaver.com
Originally sent to PostgreSQL general ML.
Thank you.
---------- Forwarded message ---------
From: Igor Korot <ikorot01@gmail.com>
Date: Sun, Nov 23, 2025 at 4:44 AM
Subject: ODBC fails to recognize event trigger removal
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Hi, ALL,
[code]
postgres=# CREATE OR REPLACE FUNCTION __watch_schema_changes() RETURNS
event_trigger LANGUAGE plpgsql AS $$ BEGIN NOTIFY tg_tag; END; $$;
CREATE FUNCTION
postgres=# CREATE EVENT TRIGGER schema_change_notify ON
ddl_command_end WHEN TAG IN('CREATE TABLE', 'ALTER TABLE', 'DROP
TABLE', 'CREATE INDEX', 'DROP INDEX') EXECUTE PROCEDURE
__watch_schema_changes();
CREATE EVENT TRIGGER
postgres=# DROP EVENT TRIGGER schema_change_notify CASCADE;
DROP EVENT TRIGGER
postgres=# \q
igor@WaylandGnome ~/unixODBC-2.3.12 $ isql postgres postgres wasqra123
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| echo [string] |
| quit |
| |
+---------------------------------------+
SQL> CREATE OR REPLACE FUNCTION __watch_schema_changes() RETURNS
event_trigger LANGUAGE plpgsql AS $$ BEGIN NOTIFY tg_tag; END; $$;
SQLRowCount returns -1
SQL> CREATE EVENT TRIGGER schema_change_notify ON ddl_command_end WHEN
TAG IN('CREATE TABLE', 'ALTER TABLE', 'DROP TABLE', 'CREATE INDEX',
'DROP INDEX') EXECUTE PROCEDURE __watch_schema_changes();
[ISQL]ERROR: Could not SQLExecute
SQL> quit
igor@WaylandGnome ~/unixODBC-2.3.12 $
[/code]
Server version 16.2
Driver version 11.1
Anybody aware of this?
Thank you.
On 11/23/25 08:41, Adrian Klaver wrote:
On 11/23/25 04:44, Igor Korot wrote:
Hi, ALL,
igor@WaylandGnome ~/unixODBC-2.3.12 $
[/code]Server version 16.2
Driver version 11.1Anybody aware of this?
1) There is a Postgres list dedicated to the ODBC driver:
https://www.postgresql.org/list/pgsql-odbc/
You should probably ask these sort of questions there.
2) I have to believe the below is the issue:
Server version 16.2
Driver version 11.1Given that the most recent current driver is REL-17_00_0006 and from here:
https://github.com/postgresql-interfaces/psqlodbc/tree/REL-11_01_0000
The 11.1 driver was released 6 years ago which predates the release of
Postgres 16 by ~4.5 years.
1) I see you did a Fwd to the pgsql-odbc, that is not really the way to
go as the content is now split across two lists. Start a new thread on
pgsql-odbc.
2) Did you read what I wrote above about the driver version age vs the
Postgres 16 age?
Thank you.
--
Adrian Klaver
adrian.klaver@aklaver.com