Posted in Postgresql

PostgreSQL Notebook: Generate SQL Backup of Create View/Table Statement

To output a create statement for a table in an operational database, one with appropriate and valid permissions can do the following:

pg_dump -t 'yourSchema.yourTableName' --schema-only yourDatabase > /path/to/filename.sql

This is especially useful for incremental backups of changing operational database.

Advertisements

Author:

I am a software developer located in the Washington, DC Metro Area.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s