Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sbLBp-00FsX6-98 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2024 14:29:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sbLBm-000Eb1-RE for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2024 14:29:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sbLBm-000Eap-HC for pgsql-hackers@lists.postgresql.org; Tue, 06 Aug 2024 14:29:26 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sbLBk-003OKS-04 for pgsql-hackers@postgresql.org; Tue, 06 Aug 2024 14:29:25 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2f136e23229so7581331fa.1 for ; Tue, 06 Aug 2024 07:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722954562; x=1723559362; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fCPHpSgii+r16dD/YQ64mN8RzQ9GwmaWfMMsE7R3Av4=; b=fpxHrbAiPRlbKJY/ORLfLWvDCpTJ8ZFITqULiy2CpzdLQEcgYRtqlUxXJoJzuspqoI Fe9gFSEALD0UV1EAiaK2rOs2RpW2ex3wAAJTpvEJ1t07f2cHZPPPJXw5VxCh/vn+NznH x3aZhOAgpP2qpW205ZUtSjYoPwQx+7Hfnf/UjJIdKA14hGtj5bGF6kzZsfuFfst8E6Nm yxkFW+tp5MTyjEkQwu6iuxUTHgYCPSfazqyGClHWjOtBGAbnidXA4e6L7We77wplFcbx D/JXO1AcTKV2CHQYBA6/dtU+NQLQxniqxUvJM4qrGdK9/Nk/Quivk7gG94CfOAyxzz2H MVLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722954562; x=1723559362; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fCPHpSgii+r16dD/YQ64mN8RzQ9GwmaWfMMsE7R3Av4=; b=KDljmodHf6XNxpsRrgUVwWUyv3rLQWPax/mEdjdH70F1TOCy+zcPMMdNVR4Hy6eMih nYVUi90Rbo+N3+2lZauet8bmoaZ+xj1tIQJqLKpD4243Axg8tgJQHodq8E3CsfgvBUEy PW8eE4aYFKx3pN40wmEN8E9XrEJSR2Dj7xeX1UkTbDYJuVmGK2h9V0q7MSTbZrLbtf6/ aI8mBE890pbeUeOOYc889Zsujdi6v4nuIhRMp/r1f4NStgG/cl+j0I6e4sXbafBw8Kd9 dnBT+VvPieyrVqNxAtXmafe1Gaak/45HIFHqjkdFkZNgdZd05s5TruULvzG3sZlAg6wF EPSg== X-Forwarded-Encrypted: i=1; AJvYcCVIKh7vHMAi4Ignntu/GBa1mAOELDTtswpw+Ww51u+LCXujMkZkteaNK4TIZOERQ+1FUrq4PnNq94V/vIVgr7h7Ggx1JhBU0qF+Cpki X-Gm-Message-State: AOJu0YyMPzeTd47VP3aY0ljUdjFNgYiT+JU2Yqh7b8ibuHtDKWHk9TSf 6PipIoTnaDV83XjnuCo6TRFyp8+K2yipyFgUx6fYSZ8dZYusgqZ+GJlh4BdzZEjB0ke1DX+LluH t/MV2IpDzk34l2BrUDheN4U7OQhc= X-Google-Smtp-Source: AGHT+IHzzm/NsP1krq75jQblI9Art8wvMx1SAdjE+Ea8JXZ4CzCfO4LXgRxioGxFUdyzn+y0dS9bGG3hradU4rk71rs= X-Received: by 2002:a2e:3305:0:b0:2ef:2006:bfb1 with SMTP id 38308e7fff4ca-2f15aa934cfmr110480911fa.15.1722954561872; Tue, 06 Aug 2024 07:29:21 -0700 (PDT) MIME-Version: 1.0 References: <20230828115252.c1b018605b9a0756a30c3382@sraoss.co.jp> <20230828160530.adde1e20f257d7d345989163@sraoss.co.jp> <20230902.204634.955758704959569058.t-ishii@sranhm.sra.co.jp> <20240123162327.c2803162619dd7634cca0b6c@sraoss.co.jp> <20240304115846.2275fb44fd904e8789d43590@sraoss.co.jp> <20240329234700.73ff2e28c9248d29f8fa6a66@sraoss.co.jp> <20240331225931.712683cecb26862b73b2b822@sraoss.co.jp> <20240702170311.1ddb417759a48ff12c555b92@sranhm.sraoss.co.jp.sranhm> <20240711132357.fe3f78c184cfa99159208178@sranhm.sraoss.co.jp> In-Reply-To: <20240711132357.fe3f78c184cfa99159208178@sranhm.sraoss.co.jp> From: Kirill Reshke Date: Tue, 6 Aug 2024 19:29:09 +0500 Message-ID: Subject: Re: Incremental View Maintenance, take 2 To: Yugo NAGATA Cc: Peter Smith , jian he , Tatsuo Ishii , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 11 Jul 2024 at 09:24, Yugo NAGATA wrote: > > On Tue, 2 Jul 2024 17:03:11 +0900 > Yugo NAGATA wrote: > > > On Sun, 31 Mar 2024 22:59:31 +0900 > > Yugo NAGATA wrote: > > > > > > > > Also, I added a comment on RelationIsIVM() macro persuggestion from jian he. > > > > In addition, I fixed a failure reported from cfbot on FreeBSD build caused by; > > > > > > > > WARNING: outfuncs/readfuncs failed to produce an equal rewritten parse tree > > > > > > > > This warning was raised since I missed to modify outfuncs.c for a new field. > > > > > > I found cfbot on FreeBSD still reported a failure due to > > > ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS because the regression test used > > > wrong role names. Attached is a fixed version, v32. > > > > Attached is a rebased version, v33. > > I updated the patch to bump up the version numbers in psql and pg_dump codes > from 17 to 18. > > Regards, > Yugo Nagata > > > > > Regards, > > Yugo Nagata > > > > > > -- > > Yugo NAGATA > > > -- > Yugo NAGATA Small updates with something o found recent days: ``` db2=# create incremental materialized view v2 as select * from v1; ERROR: VIEW or MATERIALIZED VIEW is not supported on incrementally maintainable materialized view ``` Error messaging is not true, create view v2 as select * from v1; works fine. ``` db2=# create incremental materialized view vv2 as select i,j2, i / j2 from t1 join t2 on true; db2=# insert into t2 values(1,0); ERROR: division by zero ``` It is very strange to receive `division by zero` while inserting into relation, isn't it? Can we add some hints/CONTEXT here? Regular triggers do it: ``` db2=# insert into ttt values(100000,0); ERROR: division by zero CONTEXT: PL/pgSQL function f1() line 3 at IF ``` -- Best regards, Kirill Reshke