Re: don't create storage when unnecessary

2019-01-04 Thread Michael Paquier
On Fri, Jan 04, 2019 at 09:19:25AM -0300, Alvaro Herrera wrote: > I'll do it. Thanks for taking care of it. Please note that commands/copy.c also makes use of RELKIND_CAN_HAVE_STORAGE() as of bf491a9. Could you split the renaming with a commit independent on what is being discussed on this threa

Re: don't create storage when unnecessary

2019-01-04 Thread Alvaro Herrera
On 2019-Jan-04, Peter Eisentraut wrote: > On 18/12/2018 08:18, Amit Langote wrote: > > Sorry to be saying it late, but I have to agree with Horiguchi-san here > > that RELKIND_HAS_STORAGE sounds better and is clear. > > I think I agree. Does someone want to send a patch? I'll do it. -- Álvaro

Re: don't create storage when unnecessary

2019-01-04 Thread Peter Eisentraut
On 18/12/2018 08:18, Amit Langote wrote: > Sorry to be saying it late, but I have to agree with Horiguchi-san here > that RELKIND_HAS_STORAGE sounds better and is clear. I think I agree. Does someone want to send a patch? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL D

Re: don't create storage when unnecessary

2018-12-17 Thread Amit Langote
Hi, On 2018/12/18 14:56, Kyotaro HORIGUCHI wrote: > Hello. > > At Sun, 16 Dec 2018 17:47:16 -0300, Alvaro Herrera > wrote in <20181216204716.jddzijk3fb2dpdk4@alvherre.pgsql> >> On 2018-Dec-07, Michael Paquier wrote: >> >>> A macro makes sense to control that. >> >> I added Ashutosh's RELKIND_HA

Re: don't create storage when unnecessary

2018-12-17 Thread Michael Paquier
On Sun, Dec 16, 2018 at 05:47:16PM -0300, Alvaro Herrera wrote: > I don't follow. When a relfilenode is passed by callers, they indicate > that the storage has already been created. Contrariwise, when a > relation kind that *does* have storage but is not yet created, they > pass InvalidOid as rel

Re: don't create storage when unnecessary

2018-12-17 Thread Kyotaro HORIGUCHI
Hello. At Sun, 16 Dec 2018 17:47:16 -0300, Alvaro Herrera wrote in <20181216204716.jddzijk3fb2dpdk4@alvherre.pgsql> > On 2018-Dec-07, Michael Paquier wrote: > > > A macro makes sense to control that. > > I added Ashutosh's RELKIND_HAS_STORAGE, but renamed it to > RELKIND_CAN_HAVE_STORAGE, beca

Re: don't create storage when unnecessary

2018-12-17 Thread Alvaro Herrera
Rebased over today's conflicting commits. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 4d5b82aaa9..b128959cb7 100644 --- a/src/backend/

Re: don't create storage when unnecessary

2018-12-16 Thread Alvaro Herrera
On 2018-Dec-07, Michael Paquier wrote: > A macro makes sense to control that. I added Ashutosh's RELKIND_HAS_STORAGE, but renamed it to RELKIND_CAN_HAVE_STORAGE, because some of the relkinds can be mapped and thus would have relfilenode set to 0. I think this is a bit misleading either way. > N

Re: don't create storage when unnecessary

2018-12-06 Thread Michael Paquier
On Thu, Dec 06, 2018 at 06:55:52PM -0300, Alvaro Herrera wrote: > Some time ago, after partitioned indexes had been pushed, I realized > that even though I didn't want them to have relfilenodes, they did. And > looking closer I noticed that *a lot* of relation kinds that didn't need > relfilenodes

Re: don't create storage when unnecessary

2018-12-06 Thread Andres Freund
Hi, On 2018-12-06 18:55:52 -0300, Alvaro Herrera wrote: > Some time ago, after partitioned indexes had been pushed, I realized > that even though I didn't want them to have relfilenodes, they did. And > looking closer I noticed that *a lot* of relation kinds that didn't need > relfilenodes, had t

don't create storage when unnecessary

2018-12-06 Thread Alvaro Herrera
Some time ago, after partitioned indexes had been pushed, I realized that even though I didn't want them to have relfilenodes, they did. And looking closer I noticed that *a lot* of relation kinds that didn't need relfilenodes, had them anyway. This patch fixes that; if no relfilenode is needed,