Skip to content
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

CamelCase notation for PostgreSQL function name might cause confusion. #10842

Open
lobbikerivm opened this issue Sep 13, 2024 · 1 comment
Open

Comments

@lobbikerivm
Copy link

CREATE OR REPLACE FUNCTION generateIdentifierFromStoredProcedure()

The actual function created by running this SQL statement is generateidentifierfromstoredprocedure(), without the CamelCase Capitals. If someone would for example manualy create a function with the CamelCase name it will not work, because PostgreSQL will add "" around the function name.

By the way, I used this functionality to get a PID with a random UUID4, by using the function like this:

CREATE OR REPLACE FUNCTION generateidentifierfromstoredprocedure()
RETURNS varchar AS $$
DECLARE
identifier varchar;
BEGIN
identifier := (select gen_random_uuid())::varchar;
RETURN identifier;
END;
$$ LANGUAGE plpgsql IMMUTABLE;

which works nicely :)!

great job on the multiple PID providers!

Stefan

@pdurbin
Copy link
Member

pdurbin commented Sep 13, 2024

Interesting. It sounds like small amount of value we get in readability from the camelCase version don't justify the potential confusion you're pointing out. I don't have any objection to making it all lower case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants