Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 September PostgreSQL: Generate full Database Script using PGAdmin Tool

PostgreSQL: Generate full Database Script using PGAdmin Tool

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

Before few days back, One of the SQL Server Developer asked me this question.
How to generate full database schema script or data script in PostgreSQL?

In PostgreSQL, We can also generate Database full script using Backup Option of PGAdmin tool.
When we require to create a fresh database without data, mostly we require to generate Database Schema Script.
We have one PLAIN text database backup type in PostgreSQL, which creates .sql file including Schema + Data.

Below are screenshots to generate Database Script using PGAdmin Tool:

Step 1:
Right click on the database and select backup option.
In backup dialog box, select PLAIN backup type and give a file name.

Postgresql Plain Text Backup

Step 2:
Default PLAIN text backup included both Database Schema + Data script.
In case of any changes, go to dump option tab and select data or schema only.

Postgresql Plain Data Schema Option

Step 3:
If you want to filter your objects, go to object tab and check or unchecked objects from the list.

Postgresql Plain Backup Object Selection

Sep 5, 2016Anvesh Patel
PostgreSQL: Important Statistics Table, Used by the Query PlannerPostgreSQL: Script to find information about the Locks held by Open Transactions (pg_locks)
Comments: 4
  1. Vijay
    August 23, 2018 at 9:41 am

    Very nice artical

  2. Suresh
    May 29, 2019 at 1:38 pm

    HI Anvesh,

    I am using postgresql and pgadmin of 11 version. While trying to generate script for only tables (not functions) through backup , there is no object filters as your shared screens.
    Please help me that how to generate schema script of only tables in postgresql.

    Thanks
    T.Suresh

  3. RAUSHAN KUMAR
    October 12, 2019 at 4:53 pm

    Hello Sir,
    Can you explain how to we create a script for TRUNCATE ,vacuum full,analyse ,reindex table for table in PostgreSQL 9.4

  4. 5804146236380
    October 14, 2019 at 2:12 pm

    hello, i have a question, is possible generate a backup with schema, primary keys, foreign keys, functions, tiggers…all structure, but only with 100 records?. How can i do it?

Anvesh Patel
Anvesh Patel

Database Engineer

September 5, 2016 PostgreSQLAnvesh Patel, backup, database, Database Full Script, database research and development, dbrnd, migration, PLAIN Text Backup, plpgsql, Postgres Query, postgresql, PostgreSQL Administrator, PostgreSQL Error, PostgreSQL Programming, PostgreSQL Tips and Tricks, SQL Script
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....