From 020f4c488f8df3e777b75555dd555d2deabfca8b Mon Sep 17 00:00:00 2001 From: Hamed Ahmadi Date: Mon, 24 Jul 2017 10:29:22 -0700 Subject: [PATCH] Fixing issue with search_path --- pg_events/core/schemas/triggers.sql | 6 ++---- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pg_events/core/schemas/triggers.sql b/pg_events/core/schemas/triggers.sql index 40f1b62..ffdbea3 100644 --- a/pg_events/core/schemas/triggers.sql +++ b/pg_events/core/schemas/triggers.sql @@ -45,12 +45,10 @@ BEGIN AND table_name NOT LIKE '\_%' LOOP command := format( - 'SET search_path TO %s; ' || 'DROP TRIGGER IF EXISTS %s ON %s; ' || - 'CREATE TRIGGER %2$s AFTER INSERT OR UPDATE OR DELETE ON %3$s FOR EACH ROW EXECUTE PROCEDURE pgevents_data_update_notify();', - quote_ident(rec.table_schema), + 'CREATE TRIGGER %1$s AFTER INSERT OR UPDATE OR DELETE ON %2$s FOR EACH ROW EXECUTE PROCEDURE pgevents_data_update_notify();', format('pgevents_%s__%s', quote_ident(rec.table_schema), quote_ident(rec.table_name)), - quote_ident(rec.table_name) + format('%s.%s', quote_ident(rec.table_schema), quote_ident(rec.table_name)) ); EXECUTE command; RETURN NEXT command; diff --git a/setup.py b/setup.py index 4f7b4e7..1467c1a 100644 --- a/setup.py +++ b/setup.py @@ -6,14 +6,14 @@ setup( name='pg_events', - version='0.1.5', + version='0.1.6', description="Postgres events", long_description='', keywords='postgres python django trigger listen notify events heroku connect', author='ZeroCater', author_email='tech@zerocater.com', url='https://github.com/ZeroCater/pg_events', - download_url='https://github.com/ZeroCater/pg_events/tarball/0.1.5', + download_url='https://github.com/ZeroCater/pg_events/tarball/0.1.6', license='MIT', packages=setuptools.find_packages(), package_data={'pg_events': ['core/schemas/*.sql']},