pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #15752: Declarative partitions trigger with function attributes - empty attributes list on each partition
2+ messages / 2 participants
[nested] [flat]
* BUG #15752: Declarative partitions trigger with function attributes - empty attributes list on each partition
@ 2019-04-14 11:51 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2019-04-14 11:51 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: kamil.kukielka@gmail.com
The following bug has been logged on the website:
Bug reference: 15752
Logged by: Kamil Kukielka
Email address: kamil.kukielka@gmail.com
PostgreSQL version: 11.2
Operating system: Debian 4.9.0
Description:
When trigger is created on partitioned table with execute function with
attributes, each partition calls function without defined values. That makes
triggers on partitioned tables little less useful.
```
-- partitioned table
CREATE TABLE IF NOT EXISTS test_part(id serial, description text) PARTITION
BY hash(id);
-- partitions
CREATE TABLE IF NOT EXISTS test_p0 PARTITION OF test_part FOR VALUES WITH
(MODULUS 2, REMAINDER 0);
CREATE TABLE IF NOT EXISTS test_p1 PARTITION OF test_part FOR VALUES WITH
(MODULUS 2, REMAINDER 1);
-- sample trigger function
CREATE OR REPLACE FUNCTION trigger_test() RETURNS trigger AS $$
BEGIN
RAISE NOTICE 'TG_NARGS: %', TG_NARGS;
RAISE NOTICE 'TG_ARGV: %', TG_ARGV::text;
RETURN NULL;
END;
$$
LANGUAGE plpgsql;
CREATE TRIGGER test_with_part_trigger AFTER UPDATE ON test_part FOR EACH ROW
EXECUTE FUNCTION trigger_test('sample params', 1, 2, 3);
INSERT INTO test_part(description) SELECT 'table with partition';
UPDATE test_part SET description = 'table with partition';
/**
-- code result
NOTICE: TG_NARGS: 0
NOTICE: TG_ARGV: <NULL>
UPDATE 1
*/
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #15752: Declarative partitions trigger with function attributes - empty attributes list on each partition
@ 2019-07-09 21:26 Alvaro Herrera <alvherre@2ndquadrant.com>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2019-07-09 21:26 UTC (permalink / raw)
To: kamil.kukielka@gmail.com; pgsql-bugs@lists.postgresql.org
On 2019-Apr-14, PG Bug reporting form wrote:
> When trigger is created on partitioned table with execute function with
> attributes, each partition calls function without defined values. That makes
> triggers on partitioned tables little less useful.
Hello, I pushed a fix for this (thanks, Patrick McHardy). It'll
appear in the set of stable releases scheduled for next month.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-07-09 21:26 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-04-14 11:51 BUG #15752: Declarative partitions trigger with function attributes - empty attributes list on each partition PG Bug reporting form <noreply@postgresql.org>
2019-07-09 21:26 ` Alvaro Herrera <alvherre@2ndquadrant.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox