Skip to content

cannot create a function via SQL command #1326

@halmai

Description

@halmai

Preconditions

  • HeidiSQL version: Version 11.1.0.6211 (64 Bit)
  • Database type and version: PostgreSQL 11.9 (Debian 11.9-0+deb10u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
  • OS: win10

Describe the bug

Creating a function via a CREATE FUNCTION command doesn't work.

To Reproduce

  1. Open a new Query Tab
  2. Paste the below code:
CREATE FUNCTION x() RETURNS INT LANGUAGE plpgsql AS $$
BEGIN 
  RETURN 1;
END;
$$;
  1. Ctrl-A (Edit -> Select All)
  2. F9 (Query -> Run)

Screenshots or Crash reports

I get this error message:

ERROR:  unterminated dollar-quoted string at or near "$$
BEGIN 
  RETURN 1"
LINE 1: CREATE FUNCTION x() RETURNS INT LANGUAGE 
plpgsql AS $$
                                                            ^

Executing the same command from psql works well so the syntax is correct. Heidi also should be able to execute it, I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDefective behaviour in HeidiSQLconfirmedIssue verified by project membernettype-postgresqlPostgreSQL specific issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions