I want to export my model to a PostgreSQL database. If I do so as is, the objects are built in the Public schema, because the model doesn't specify a schema, and Public happens to be the default. Does anyone know a way to specify a schema in PowerDesigner?
I can change the default schema in the database, but that seems a little cheesy to me. I ought to be able to control that in my modeling tool, it seems to me.
In Object Explorer, expand the Databases folder. Expand the database in which to create the new database schema. Right-click the Security folder, point to New, and select Schema. In the Schema - New dialog box, on the General page, enter a name for the new schema in the Schema name box.
Schema is of three types: Logical Schema, Physical Schema and view Schema.
Go to the Tools Menu
Go to Model Options
Under Category>Model Settings>Table & View
Then you'll see Default owner on the right side.
PD is a great tool because it's very easy to try out simple cases. Follow these steps.
Now right click on the PDM in the browser pane and choose the preview tab.
You'll see:
Notice how the preview for table_2 has DBO. in front of the table name EXACTLY as you desire. I've also included in the screencap the screen for the List of Tables. You get to that via the Model menu. Notice how the owner is set to the DBO user for table_2, exactly like in the previewed DDL. If you go into the properties for table_1 or use this screen to change ALL of your tables en masse, all of your DDL will work the way you want.
create [%Temporary% ]table [%QUALIFIER%]%TABLE% (
%TABLDEFN%
)
[%OPTIONS%]
Not sure what the %QUALIFIER% variable gets filled with but it seems to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With