Re: [GENERAL] Disabling inheritance with query. - Mailing list pgsql-general

From Scott Marlowe
Subject Re: [GENERAL] Disabling inheritance with query.
Date
Msg-id CAOR=d=3hgde1KACiOyqZ71Qr6N9sLO4C25muvAVR45j11kT9SQ@mail.gmail.com
Whole thread Raw
In response to [GENERAL] Disabling inheritance with query.  (Edmundo Robles <edmundo@sw-argos.com>)
List pgsql-general
On Wed, Dec 21, 2016 at 3:36 PM, Edmundo Robles <edmundo@sw-argos.com> wrote:
> Hi!
>
> i need  disable  inheritance  from many tables in a query like
>
> "delete from pg_inherits where inhparent=20473"  instead alter table ...
>
> but  is safe?   which is the risk for  database if  i  delete it?

You could change the source query to use the only keyword:

delete from only parenttable where ...

OR you could write a rule or trigger that rewrote the query to have
the only keyword in it under certain circumstances.


pgsql-general by date:

Previous
From: Rui Pacheco
Date:
Subject: [GENERAL] UTF-8 on Postgres wire protocol
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] error updating a tuple after promoting a standby