Re: Add CREATE support to event triggers - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Add CREATE support to event triggers
Date
Msg-id 20141028100007.GC2639@awork2.anarazel.de
Whole thread Raw
In response to Re: Add CREATE support to event triggers  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Add CREATE support to event triggers
List pgsql-hackers
On 2014-10-28 05:30:43 -0300, Alvaro Herrera wrote:
> > A couple of comments: this patch introduces a basic infrastructure able to
> > do the following set of operations:
> > - Obtention of parse tree using StashedCommand
> > - Reorganization of parse tree to become an ObjTree, with boolean, array
> > - Reorganization of ObjTree to a JsonB value
> > I am actually a bit doubtful about why we actually need this intermediate
> > ObjTree step... What would be wrong in manipulating a JSON(B) parsed tree,
> > that is first empty, and pushing key/value objects to it when processing
> > each command? Something moving toward in this direction is that ObjTree has
> > some logic to manipulate booleans, null values, etc. This results in some
> > duplication with what jsonb and json can actually do when creating when
> > manipulating strings, as well as the extra processing like
> > objtree_to_jsonb_element. ddl_json.c (should be ddl_jsonb.c?) would as well
> > take more its sense as it directly manipulates JSONB containers.
> 
> Uhm.  Obviously we didn't have jsonb when I started this and we do have
> them now, so I could perhaps see about updating the patch to do things
> this way; but I'm not totally sold on that idea, as my ObjTree stuff is
> a lot easier to manage and the jsonb API is pretty ugly.

I looked at this as well, and I think trying to do so would not result
in readable code.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Autovacuum fails to keep visibility map up-to-date in mostly-insert-only-tables
Next
From: 'Andres Freund'
Date:
Subject: Re: On partitioning