Skip to content

pq: syntax error at or near "." error received when calling functions with schema in front.Β #722

@hfhchan-plb

Description

@hfhchan-plb

Description

pq: syntax error at or near "." appearing on a migration script where schema is specified before a function.

Same migration works when deployed via 2.28.0.

  • Version: 2.29.0
  • Database: postgres
  • Operating System: linux (Github CI)

Steps To Reproduce

All 3 versions of this failed to migrate on v2.29.0 invoked via the command line:

-- migrate:up
SELECT audit.attach_trigger('public.table_name', 'security_id');

-- migrate:down
DROP TRIGGER table_name_audit_insert ON public.table_name;
DROP TRIGGER table_name_audit_update ON public.table_name;
DROP TRIGGER table_name_audit_delete ON public.table_name;
DROP TRIGGER table_name_audit_truncate ON public.table_name;
-- migrate:up
SELECT "audit"."attach_trigger"('public.table_name', 'security_id');

-- migrate:down
DROP TRIGGER table_name_audit_insert ON public.table_name;
DROP TRIGGER table_name_audit_update ON public.table_name;
DROP TRIGGER table_name_audit_delete ON public.table_name;
DROP TRIGGER table_name_audit_truncate ON public.table_name;
-- migrate:up
SELECT * FROM "audit"."attach_trigger"('public.table_name', 'security_id');

-- migrate:down
DROP TRIGGER table_name_audit_insert ON public.table_name;
DROP TRIGGER table_name_audit_update ON public.table_name;
DROP TRIGGER table_name_audit_delete ON public.table_name;
DROP TRIGGER table_name_audit_truncate ON public.table_name;

First version succeeded when running with dbmate v2.28.0 (executed via yarn). Other versions weren't tested.

All 3 versions suceeded when running directly on DBeaver connected to the database.

Expected Behavior
There should not be a warning of syntax error. The syntax is valid and accepted by PG, seemingly only being rejected by lib/pq.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions