Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1el0Q5-000405-8V for pgsql-general@arkaria.postgresql.org; Sun, 11 Feb 2018 22:48:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1el0Q4-00071c-6s for pgsql-general@arkaria.postgresql.org; Sun, 11 Feb 2018 22:48:24 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1el0Q3-00071R-V8 for pgsql-general@lists.postgresql.org; Sun, 11 Feb 2018 22:48:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1el0Px-000544-OL for pgsql-general@postgresql.org; Sun, 11 Feb 2018 22:48:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1BMmDwZ018465; Sun, 11 Feb 2018 17:48:13 -0500 From: Tom Lane To: Andres Freund cc: Nicolas Paris , pgsql-general@postgresql.org Subject: Re: New Copy Formats - avro/orc/parquet In-reply-to: <20180211211235.5x3jywe5z3lkgcsr@alap3.anarazel.de> References: <20180210151304.fonjztsynewldfba@gmail.com> <20180211211235.5x3jywe5z3lkgcsr@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sun, 11 Feb 2018 13:12:35 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18463.1518389293.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 11 Feb 2018 17:48:13 -0500 Message-ID: <18464.1518389293@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > So, I think making COPY extensible would be quite beneficial. I'm > however quite doubtful that we want to add core code to handle all of > the above. I think we should make the COPY input/output formatting > extensible by extensions. +1. I can't see carrying code for these formats in-core, but I've no objection to making it possible for someone else to maintain them. > I imagine we'd have callbacks for > - start copy in / out > - output row, with a an array of values/nulls > - parse row, with a input buffer as argument, returning values / nulls a= rrays > - finish copy in / out Also something to allow absorbing format-specific options, if the precedent of CSV is anything to go by. (Any such patch should manage to turn COPY-CSV into an extension, at least so far as copy.c is concerned, even if we don't package it as one.) regards, tom lane