Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juOaD-00027f-A9 for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 23:07:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1juOaA-0005R8-8L for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 23:06:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juOaA-0005R1-14 for pgsql-hackers@lists.postgresql.org; Sat, 11 Jul 2020 23:06:58 +0000 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1juOa7-0004AS-8q for pgsql-hackers@postgresql.org; Sat, 11 Jul 2020 23:06:57 +0000 Received: by mail-io1-xd32.google.com with SMTP id c16so9767862ioi.9 for ; Sat, 11 Jul 2020 16:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IgCcalh3IaxMhaGch9kLn3nJtYFTGZ0nOpP6MQORaLU=; b=bResF9Oz1kqrFTfs8pl3ku1ZsW/vio5ohgpH6vyInaMY6Auu3pF+ebaQYqvnwnm7d7 c0iI5OGjNWzD6lGO6WgfMFBj3ocs8iOpe/RCMToVyZuX8RagQ/Z1FzEW+lVxyTjL25Q3 8vV+yvQeeG0Vc29Ay3D2XoViUAzqpIfkezsse0TXF1O25OxldyDb/p4u2zm/sljjW/4J DAluyOoru1SHxzTUFGXB9oBCTs5EZ/yxVV/RWFG9RIzsO2oT7rs+mR7WH107nZkJCI/W JTChljejvsJWMSQ5dvcNWUsCCoVxvteaZvbEHXm6/E4RBhlD/Ffd6X6Ap/9Z6Vkq74JP d4eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IgCcalh3IaxMhaGch9kLn3nJtYFTGZ0nOpP6MQORaLU=; b=hx6JRqKEnOdXK2FceTti0BNapey+gkAhWCjnSABywbOKB25B0P/+Y5VgvZeLjIzBQ2 fgS0RwXuwMn8l3blxtNg9cR5ntBpO+cRGe+Edq4vwQ9qM5PUlnUGzxajc0byqss9qG6J VlJjXNb+wr8nRY3cUtUb9SY2d2izXLw0rc+rMNU6B9XwvzvVdJidIDBln6HQ07sRjPy4 8hfD6w3CSKRQQ83pFg187TYvnh0CiHdfeTqa++JhxXZCr7rFHB7bVR6NwAVgwcVCOeIF NTU64b3/RoGiYRz2OCHbM/PM8YGWBXNkaGe4X3fHtSLI01hWatY14K66+G7pkcN6vAog JEMQ== X-Gm-Message-State: AOAM53204HfYLMGdYrza+ZFMGFDmZSI3gTEv186Xk3ONYzXYsfPZqOH9 JrTPtTx9Uywsa4OGKBZ7vFjZJw== X-Google-Smtp-Source: ABdhPJwIaDyigHPV0DjrGq+HYxmMtI5GoxUqcQD5UamL5HfZgVqB1O81vn2BJPytQO1S4FC32lUtJw== X-Received: by 2002:a6b:4409:: with SMTP id r9mr53176049ioa.158.1594508812575; Sat, 11 Jul 2020 16:06:52 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id l22sm5594635ioc.24.2020.07.11.16.06.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Jul 2020 16:06:51 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 832B58009C4; Sat, 11 Jul 2020 18:06:50 -0500 (CDT) Date: Sat, 11 Jul 2020 18:06:50 -0500 From: Justin Pryzby To: Pavel Stehule Cc: pgsql-hackers@postgresql.org Subject: Re: proposal: possibility to read dumped table's name from file Message-ID: <20200711230650.GY26220@telsasoft.com> References: <20200529182514.GL17850@telsasoft.com> <20200608212957.GB22473@telsasoft.com> <20200609223042.GF26811@telsasoft.com> <20200701212452.GF4107@telsasoft.com> <20200705203119.GT4107@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Jul 06, 2020 at 06:34:15AM +0200, Pavel Stehule wrote: > >> > Comment support is still missing but easily added :) > >> Still missing from the latest patch. > > > > I can implement a comment support. But I am not sure about the format. The > > here is support for comment's line - first char should be # Thanks, that's how I assumed it would look. > >> With some added documentation, I think this can be RfC. Do you want to add any more documentation ? Few more things: > +exit_invalid_filter_format(FILE *fp, char *filename, char *message, char *line, int lineno) > +{ > + pg_log_error("invalid format of filter file \"%s\": %s", > + *filename == '-' ? "stdin" : filename, > + message); You refer to as "stdin" any filename beginning with -. I think you could just print "-" and not "stdin". In any case, *filename=='-' is wrong since it only checks filename[0]. In a few places you compare ==stdin (which is right). Also, I think "f" isn't as good a name as "fp". You're adding 139 lines to a 600 line main(), and no other option is more than 15 lines. Would you put it in a separate function ? -- Justin