Re: Triggers when importing data

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Sathish Kumar <satcse88(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Triggers when importing data
Date: 2018-11-29 13:46:25
Message-ID: ad8c4f4c-8ce0-9006-8253-602413d06a5f@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/28/18 9:43 PM, Sathish Kumar wrote:
> Hi,
>
> I am trying to export and import sql file of a database. I would like to know whether it will execute all the triggers when importing the sql dump which is for Insert or Update or Delete.

Well you command as constructed below will have no INSERTs(or UPDATES OR
DELETES). The data will be moved into the tables using COPY. Even if you
use --inserts(https://www.postgresql.org/docs/10/app-pgdump.html) that
is all you will get. Can you explain more what it is you are trying to
achieve or expect?

>
> Export:pg_dump -h test -U db_admin --format=plain --no-owner --no-acl production | sed -E 's/(DROP|CREATE|COMMENT ON) EXTENSION/-- \1 EXTENSION/g' > test.sql
>
> Import: psql -h test -U db_admin -d production -W < test.sql
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-11-29 15:31:20 Dump table using pg_dump vs pg_restore -f
Previous Message Condor 2018-11-29 09:31:34 Re: Reg: Query for DB growth size