-
Notifications
You must be signed in to change notification settings - Fork 351
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
- OS: Debian
- Database Type: PostgreSQL
A plpgSQL function with the following content in the database:
DROP FUNCTION IF EXISTS fn_change_user_name;
CREATE OR REPLACE FUNCTION public.fn_change_user_name(p_user_id integer, p_name text)
RETURNS vw_user
LANGUAGE plpgsql
AS $function$
UPDATE public.user set u_firstname = p_name where id = p_user_id;
SELECT * FROM vw_user WHERE id = p_user_id;
$function$
The plugin will show
**> Run SQL**
DROP FUNCTION IF EXISTS fn_change_user_name;
**> Run SQL**
CREATE OR REPLACE FUNCTION public.fn_change_user_name(p_user_id integer, p_name text)
RETURNS vw_user
LANGUAGE plpgsql
AS $function$
UPDATE public.user set u_firstname = p_name where id = p_user_id;
**> Run SQL**
SELECT * FROM vw_user WHERE id = p_user_id;
**> Run SQL**
$function$
Because it seems to only check if a SQL command ends with dot comma. But pl/pgsql functions are inside function blocks that are indicated with $$ for start, and $$ for end. Or named
Expected result:
**> Run SQL**
DROP FUNCTION IF EXISTS fn_change_user_name;
**> Run SQL**
CREATE OR REPLACE FUNCTION public.fn_change_user_name(p_user_id integer, p_name text)
RETURNS vw_user
LANGUAGE plpgsql
AS $function$
UPDATE public.user set u_firstname = p_name where id = p_user_id;
SELECT * FROM vw_user WHERE id = p_user_id;
$function$
In other words, SQL block recognition is missing.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working