Skip to content

bug: incorrect generation of DDL definitions for objects with built-in trigger functions #227

@konstantinovaleksej

Description

@konstantinovaleksej

Steps to reproduce:

  1. Create sample table and trigger:

CREATE TABLE public.my_table
(
title TEXT,
description TEXT,
fulltext TSVECTOR
);

CREATE OR REPLACE TRIGGER my_table_fulltext_trigger
BEFORE INSERT OR UPDATE
ON public.my_table
FOR EACH ROW
EXECUTE FUNCTION tsvector_update_trigger(fulltext, 'pg_catalog.english',
title, description);

  1. Select 'my_table' in database explorer, click right mouse button and select 'Script as Create';
  2. See wrong DDL-command without built-in trigger function name (after EXECUTE FUNCTION):

-- Trigger: my_table_fulltext_trigger
CREATE OR REPLACE TRIGGER my_table_fulltext_trigger
BEFORE INSERT OR UPDATE
ON public.my_table
FOR EACH ROW
EXECUTE FUNCTION (fulltext, pg_catalog.english, title, description);

PostgreSQL extension:
Identifier: ms-ossdata.vscode-pgsql
Version: 1.16.0

VSCode:
Version: 1.109.5 (system setup)
Commit: 072586267e68ece9a47aa43f8c108e0dcbf44622
Date: 2026-02-19T19:43:32.382Z
Electron: 39.3.0
ElectronBuildId: 13313481
Chromium: 142.0.7444.265
Node.js: 22.21.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.19045

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions