Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1MNg-0007oC-Ug for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Mar 2019 02:34:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1MNf-0006R5-F0 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Mar 2019 02:34:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1MNe-0006Qy-CO for pgsql-hackers@lists.postgresql.org; Wed, 06 Mar 2019 02:34:03 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1MNb-00067M-EB for pgsql-hackers@postgresql.org; Wed, 06 Mar 2019 02:34:02 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1659F22127; Tue, 5 Mar 2019 21:33:58 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 05 Mar 2019 21:33:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= from:to:cc:subject:in-reply-to:reply-to:date:message-id :mime-version:content-type; s=fm3; bh=67U0gsSFahJh1TS6p0+Uka3S9f 7dSUQsghh/B6VUaLc=; b=QWxPvYjE5s/nXqinyY+eB8EXWEiAelzbKT103W0D3e xIRMmHv5s5xp8boH9WeM9PAh7iy0ybt6HmKeqom5co1XgYssirHMmuJ34LNXqDji Wd9eBq92APrLg5Ahxi0PYgrcl+/HY1PyNmBgkWKQCIvKbE3JhsRrwkU5DHaXc79P BLCbhbmSc10jiZ5K+jZdoy/pwCIsmXMT9gV9i1VgmtV/sXFLmJdOIMjNNQVHwwFA UR80lLR7j/lN5aOziMh0M96yFtCvjHmeEDUSPewELcmGrQ8CcJbeGutwMg3cLhL3 1M8gli5zsfMbTXVsOh4LIEcxP7BVBPb6UYoQ5htSjOdQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:reply-to:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=67U0gs SFahJh1TS6p0+Uka3S9f7dSUQsghh/B6VUaLc=; b=rwNJoJLh45EeThnznZ5oAT //8ffgheYRrEbSYWuBQ/ZTaVkqd5+uJ2Ks31LmDF2y1+BYCxPi1Z+x/S/CcHYXjY jmTlSe9YX97jnFFDXmfxl5u11XlQvgqnOz0BjHtyp5acIsz/i0AKl1S6PGXVkcqE 3Rqlr9RHbzfiT8A8uPW7YOWxLdq2E1N4uadysaUWNGggg21nb16ycm+QcOjU9Y++ vXyLMxeAvM9DlHR1UiG0ZQm8yh/vbHjfQt9oWZnXkFrkk6ldNPZA6Jovi2lCG0fB Y635xGXoqWeJEqUlSjzHXkoxWSAccDomPqk50pxdY85928g6sIhFNMWuCu4ya7zA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrfeeggdeglecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghrfffkgggtsehttdertddttddtnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkphepleekrd dvuddtrddugedtrddujedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshes rghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 5B1E610346; Tue, 5 Mar 2019 21:33:56 -0500 (EST) From: Andres Freund To: Ashwin Agrawal Cc: Heikki Linnakangas , Haribabu Kommi , Asim R P , Pg Hackers , Dmitry Dolgov <9erthalion6@gmail.com>, Alvaro Herrera , Alexander Korotkov Subject: Re: Pluggable Storage - Andres's take In-Reply-To: Reply-To: Date: Tue, 05 Mar 2019 18:33:54 -0800 Message-ID: <874l8gn33h.fsf@alap4.lan> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, Thanks for looking! On 2019-03-05 18:27:45 -0800, Ashwin Agrawal wrote: > While playing with the tableam, usage of which starts with commit > v12-0023-tableam-Introduce-and-use-begin-endscan-and-do-i.patch, should we > check for NULL function pointer before actually calling the same and ERROR > out instead as NOT_SUPPORTED or something on those lines. Scans seem like absolutely required part of the functionality, so I don't think there's much point in that. It'd just bloat code and runtime. > Understand its kind of think which should get caught during development. > But still currently it segfaults if missing to define some AM function, The segfault iself doesn't bother me at all, it's just a NULL pointer dereference. If we were to put Asserts somewhere it'd crash very similarly. I think you have a point in that: > might be easier for iterative development to error instead in common place. Would make it a tiny bit easier to implement a new AM. We could probably add a few asserts to GetTableAmRoutine(), to check that required functions are implemted. Don't think that'd make a meaningful difference for something like the scan functions, but it'd probably make it easier to forward port AMs to the next release - I'm pretty sure we're going to add required callbacks in the next few releases. Greetings, Andres Freund