Re: delta relations in AFTER triggers
Kevin Grittner <kgrittn@gmail.com>
From: Kevin Grittner <kgrittn@gmail.com>
To: David Steele <david@pgmasters.net>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>, Haribabu Kommi <kommi.haribabu@gmail.com>,
Jim Nasby <Jim.Nasby@bluetreble.com>, Craig Ringer <craig@2ndquadrant.com>,
Michael Paquier <michael.paquier@gmail.com>, Robert Haas <robertmhaas@gmail.com>, David Fetter <david@fetter.org>, Kevin Grittner <kgrittn@ymail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Amit Khandekar <amit.khandekar@enterprisedb.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2017-03-02T22:44:01Z
Lists: pgsql-hackers
On Thu, Mar 2, 2017 at 9:04 AM, David Steele <david@pgmasters.net> wrote: > On 2/20/17 10:43 PM, Thomas Munro wrote: >> Based on a suggestion from Robert off-list I tried inserting into a >> delta relation from a trigger function and discovered that it >> segfaults: >> >> * frame #0: 0x00000001057705a6 >> postgres`addRangeTableEntryForRelation(pstate=0x00007fa58186a4d0, >> rel=0x0000000000000000, alias=0x0000000000000000, inh='\0', >> inFromCl='\0') + 70 at parse_relation.c:1280 [opt] >> frame #1: 0x000000010575bbda >> postgres`setTargetTable(pstate=0x00007fa58186a4d0, >> relation=0x00007fa58186a098, inh=<unavailable>, alsoSource='\0', >> requiredPerms=1) + 90 at parse_clause.c:199 [opt] >> frame #2: 0x0000000105738530 postgres`transformStmt [inlined] >> transformInsertStmt(pstate=<unavailable>) + 69 at analyze.c:540 [opt] >> frame #3: 0x00000001057384eb >> postgres`transformStmt(pstate=<unavailable>, parseTree=<unavailable>) >> + 2411 at analyze.c:279 [opt] >> frame #4: 0x0000000105737a42 >> postgres`transformTopLevelStmt(pstate=<unavailable>, >> parseTree=0x00007fa58186a438) + 18 at analyze.c:192 [opt] >> frame #5: 0x00000001059408d0 >> postgres`pg_analyze_and_rewrite_params(parsetree=0x00007fa58186a438, >> query_string="insert into d values (1000000, 1000000, 'x')", >> parserSetup=(plpgsql.so`plpgsql_parser_setup at pl_comp.c:1017), >> parserSetupArg=0x00007fa58185c2a0, queryEnv=0x00007fa581857798) + 128 >> at postgres.c:706 [opt] > > Do you know when you will have a new patch ready? > > This looks like an interesting and important feature but I think it's > going to have to come together quickly if it's going to make it into v10. I hope to post a new version addressing review comments by Monday (6 March). -- Kevin Grittner
Commits
-
Don't permit transition tables with TRUNCATE triggers.
- 29fd3d9da0ff 10.0 landed
-
Pass EXEC_FLAG_REWIND when initializing a tuplestore scan.
- 304007d9f1f6 10.0 landed
-
Faster expression evaluation and targetlist projection.
- b8d7f053c5c2 10.0 cited
-
Remove obsoleted code relating to targetlist SRF evaluation.
- ea15e18677fc 10.0 cited
-
Implement syntax for transition tables in AFTER triggers.
- 8c48375e5f43 10.0 cited