Go to DDL of function/procedure/routine doesn't include schema

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?

9 comments
Comment actions Permalink

There is a "CREATE OR REPLACE" checkbox and "Qualify objects with schema name" dropdown in the generator dialog: 

0
Comment actions Permalink

Where do I find this generator?

0
Comment actions Permalink

So I have to change it for every possible table/function I may want to look up the DDL for?

0
Comment actions Permalink

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. 

0
Comment actions Permalink

I don't even get this SQL Generator link . This is the context menu for functions:

0
Comment actions Permalink

check "SQL scripts" dropdown

0
Comment actions Permalink

Okay thanks.. the SQL generator also includes the schema, whereas Go to DDL doesn't. just thought I'd mention it

0
Comment actions Permalink

Check the "Qualify objects" dropdown: 

0

Please sign in to leave a comment.