Re: Triggers when importing data

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Sathish Kumar <satcse88(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Triggers when importing data
Date: 2018-11-29 05:50:35
Message-ID: cc5125fab95dbbf7f953a719f0ab7c1dc6188c91.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sathish Kumar wrote:
> 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.
>
> 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

That will call all triggers on tables that have no primary key
or unique constraints.

On all other tables, that will give you a constraint violation because
the same rows are already in the table...

What are you trying to achieve?

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message R.R. PRAVEEN RAJA 2018-11-29 06:41:24 Reg: Query for DB growth size
Previous Message Sathish Kumar 2018-11-29 05:43:04 Triggers when importing data