1

Help me please , why i got the error function not exist ?

[2018-10-31 12:31:05] [42883] ERROR: function companytester(bigint, unknown, unknown, unknown, unknown) does not exist

Hint: No function matches the given name and argument types. You might need to add explicit type casts.

CREATE OR REPLACE FUNCTION companyTester(founder Founder) RETURNS BOOLEAN AS $$

BEGIN

    RAISE NOTICE 'Founder id: %',founder.founder_id;
    RAISE NOTICE 'Founder FirstName: %',founder.firstname;
    RAISE NOTICE 'Founder LastName: %',founder.lastname;
    RAISE NOTICE 'Founder email: %',founder.email;
    RAISE NOTICE 'Founder password %',founder.f_password;

END;

$$ LANGUAGE plpgsql;



 SELECT companyTester(76565445354,'Maks','Burkov','[email protected]','+_@Maks88;

CREATE TYPE Founder AS (
  founder_id BIGINT,
  firstname VARCHAR(150),
  lastname VARCHAR(150),
  email VARCHAR(50),
  f_password VARCHAR(50)
);
0

1 Answer 1

3

You are passing 5 parameters to the function, but it is declared to only accept one parameter (of type founder)

You need a row constructor to create a proper instance of founder and thus passing only a single argument:

SELECT companyTester(
             (76565445354,'Maks','Burkov','[email protected]','+_@Maks88')::founder
       );

The expression (76565445354,'Maks','Burkov','[email protected]','+_@Maks88')::founder is a single value

Alternatively you can use:

SELECT companyTester(row(76565445354,'Maks','Burkov','[email protected]','+_@Maks88'));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.