Go to DDL of function/procedure/routine doesn't include schema Follow
Answered
I am using PostgeSQL for one of my projects and have multiple schemas. For example "finance".
In that schema, I have some functions like "finance.convert_money()".
When I right-click it and select Go to DDL, there are two things that do not go as I would expect:
1. CREATE FUNCTION instead CREATE OR REPLACE
2. Name of the function doesn't have a schema, which means DDL would create a copy in public schema
CREATE FUNCTION convert_money instead CREATE OR REPLACE FUNCTION finance.covert_money
Is it possible to change this behaviour?
Please sign in to leave a comment.
There is a "CREATE OR REPLACE" checkbox and "Qualify objects with schema name" dropdown in the generator dialog:
Where do I find this generator?
So I have to change it for every possible table/function I may want to look up the DDL for?
You can open SQL Generator only in case it is needed to paste DDL somewhere.
Here is the feature request to fix that in "Generate DDL" functionality: DBE-9746
Please follow the YouTrack ticket to be notified on updates.
I don't even get this SQL Generator link . This is the context menu for functions:
check "SQL scripts" dropdown
Okay thanks.. the SQL generator also includes the schema, whereas Go to DDL doesn't. just thought I'd mention it
Check the "Qualify objects" dropdown: