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

已回答

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?

0

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

0

Where do I find this generator?

0

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

0

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

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

0

check "SQL scripts" dropdown

0

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

0

Check the "Qualify objects" dropdown: 

0

Thats clear, but how to add the schema word to the generated code by DDL button. Is kind of messy to Generate SQL everytime.

0

请先登录再写评论。