Skip to content

Extend PostgresqlSqlLexer to handle PG14 SQL-standard function body syntax #512

Closed
@mp911de

Description

@mp911de

PG14 added a new syntax for creating SQL functions that we should support with PostgresqlSqlLexer

CREATE OR REPLACE FUNCTION asterisks(n int)
  RETURNS SETOF text
  LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE
BEGIN ATOMIC
SELECT repeat('*', g) FROM generate_series (1, n) g; -- <-- Note this semicolon
END;

Right now, PostgresqlSqlLexer.tokenize(…) identifies this above as two statements. See also:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions