Work with formatting

dbForge Studio for PostgreSQL enables you to format your code, create new formatting styles in an .xml format, edit the existing ones, and share them with your team.

The topic describes how to:

Format your code

To format the code of a document, do one of the following:

  • Right-click the SQL query body and select Format > Format Document.
  • On the Edit menu, select Advanced > Format Document.
  • Press Ctrl+K,D.

To format the current statement, do one of the following:

  • Right-click the SQL query body and select Format > Format Current Statement.
  • On the Edit menu, select Advanced > Format Current Statement.
  • Press Ctrl+K,S.

To format a certain code fragment, do one of the following:

  • Select and right-click the fragment you want to format, and then select Format > Format Selection.
  • On the Edit menu, select Advanced > Format Selection.
  • Press Ctrl+K,F.

Format Selection

Apply a formatting profile

To apply the formatting profile, right-click the query document, click Active Format Profile, and choose one of the formatting profiles. After that, format the query document by pressing Ctrl+K, and then Ctrl+D.

Alternatively, you can set a different formatting style by following the steps:

1. On the Tools menu, click Options.

2. In the Options dialog that opens, switch to the Text Editor > Formatting > Profiles page.

3. Select the formatting profile you want to make active, and click Set as Active.

4. To save the changes, click OK.

For more information about how to create and edit formatting profiles, see Customize formatting profiles.

Manage formatting errors

dbForge Studio for PostgreSQL allows formatting statements without errors. The detected errors will be displayed in the Output pane.

You can define how to output errors:

1. On the Tools menu, click Options.

2. In the Options dialog that opens, navigate to Text Editor > Formatting > General.

3. In the Notifications section, select or clear the corresponding checkboxes:

  • Put syntax errors to Output window
  • Show syntax error notification window

4. To save the changes, click OK.

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for PostgreSQL.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for PostgreSQL?