Book Image

PostgreSQL for Data Architects

By : Jayadevan M
Book Image

PostgreSQL for Data Architects

By: Jayadevan M

Overview of this book

Table of Contents (19 chapters)
PostgreSQL for Data Architects
About the Author
About the Reviewers

Generating SQL

Next, let's try generating SQL for the two tables we just created. Click on Tools and select Forward Engineer. Then, choose Create in the Playpen Database and PostgreSQL as the Database Type. You will also notice the Liquibase option, mentioned earlier as a version control tool for databases. Once you click on OK, you can see the SQL generated for PostgreSQL. The SQL generated will vary depending on the database we choose. The SQL generated for PostgreSQL and Liquibase XML generated is shown in the following screenshot:

The XML generated is as follows:

Now let's connect to a database to create the tables.

Navigate to Connections | Add Source Connection | New Connection. Fill in the appropriate values and click on Test Connection. If all is well, you should see Connection test successful, as shown in the following screenshot:

Now, we can again use the Forward Engineer option and create the tables in the newly added database. The option of saving the SQL is also there.

We can also...