New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot distinguish more PgSql stored functions if their name are identitical #58

Closed
halmai opened this Issue Dec 27, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@halmai

halmai commented Dec 27, 2017

Expected behavior

I have to plpgsql functions with the same name but different argument list. (Yes, this is possible in postgresql.) In the left panel, under the Functions group, I can see both. However, the content of the CREATE Code panel shows the same content, regardless of which of them I click on the left panel.

Current behavior

Only one of the functions' CREATE code is readable, I cannot see the other one.

Failure information (for bugs)

This is a bug. The following query returns two records but only the function body belonging to the first one is shown:

SELECT "p"."prosrc", "p"."proargnames", "p"."proargtypes", "p"."prorettype"
FROM "pg_catalog"."pg_namespace" AS "n"
JOIN "pg_catalog"."pg_proc" AS "p" ON "p"."pronamespace" = "n"."oid"
WHERE "n"."nspname"=E'public'AND "p"."proname"=E'summa';

Steps to reproduce

Please provide detailed steps for reproducing the issue.

  1. create two functions with identical name and different argument list:
CREATE FUNCTION summa(integer, integer) RETURNS integer LANGUAGE plpgsql AS 
$_$
DECLARE 
	_ret INTEGER;
BEGIN
   SELECT $1 + $2 INTO _ret;
   RETURN _ret;
END;
$_$;

CREATE FUNCTION summa(integer, integer, integer) RETURNS integer LANGUAGE plpgsql AS 
$_$
DECLARE 
	_ret INTEGER;
BEGIN
   SELECT $1 + $2 + $3 INTO _ret;
   RETURN _ret;
END;
$_$;
  1. Open the Functions branch of the left-hend-side tree

  2. click each of the names once

  3. You will see that the body of the displayed function is always the first one and you cannot see the body of the second one.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • HeidiSQL version: build5201
  • Database system + version: PostgreSQL 10.1, compiled by Visual C++ build 1800, 64-bit
  • Operating system: win7
@ansgarbecker

This comment has been minimized.

Collaborator

ansgarbecker commented Apr 9, 2018

The next build should fix that. Internally, the argument types list is used to distinct between multiple procedures. E.g. your example procedures have "23 23" and the other one has "23 23 23". Taking that into account when selecting the routine body, we get only one procedure, not two.

@ansgarbecker ansgarbecker added this to the v9.6 milestone Apr 9, 2018

@halmai

This comment has been minimized.

halmai commented Apr 22, 2018

Thanks, it works well. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment