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 1jzm2q-0004F0-C3 for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Jul 2020 19:10:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jzm2I-0006Hf-AG for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Jul 2020 19:10:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jzm2I-0006HF-38 for pgsql-hackers@lists.postgresql.org; Sun, 26 Jul 2020 19:10:14 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jzm2D-0002yq-Gr for pgsql-hackers@postgresql.org; Sun, 26 Jul 2020 19:10:12 +0000 Received: by mail-io1-xd31.google.com with SMTP id k23so14753887iom.10 for ; Sun, 26 Jul 2020 12:10:09 -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=XEH4iiCCqhLRZX6JTkFEt8CMUHeHJeHlQZxm6DxyjkI=; b=AP/ZdRE0vYlTEvdqm7uJFdmDeWbVcODMoAnWHSsZY+sTavridn3A4oDJzYPBNBki+G p2Ar15KatlNgHZXqVVrajLk0bPlIG9cEC0dTJAbsl0/WLAIeLsiNbFMjEKRppAoXAB+o j3LbJkiZ4/i97kSGYEgAiZw/N1ckLM1WHk4mDL1T+rNy7DhazXNyjM4+5Fyp8tlUDCIb FPppv+HysodkYP51yRtuyXiKMLcNDHKUL5CkRZKP+mKek+4ZSm8hbcyVFh+/D0dEuCEB ipu1UefXJvjloFAQuDUta4P9REQkLhfKYk733t15ws44HASpWnSNhQps5SEoYtFiS6Uw FQew== 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=XEH4iiCCqhLRZX6JTkFEt8CMUHeHJeHlQZxm6DxyjkI=; b=OFdC3dQXxgks0mYpLgID+sYkO8DlbtlVTsghYYG475ryhNDMOVsrY/D4aKvV/58JQJ lWe4NCc2CtWHp1EyPhyuGiIabv2vl8qB/sPknlLEaQOJ7Fxc4ptyfYTKp4oEO+rb4OL5 A+ZGJBHf9OfA9wQOHfli0rnwzx41ASbFkfvVG078YLhHJMf1ZaCVbtEjpmEpUHyXpIqE 00cVk58eCKH4alrrS5boqLDHd+qbghfplANI3D9zIb6IuEF0ZpL8AzgY9BTIKs5tLEgQ FqU7erXSOGD1NvwP6z9QwObAqOruSjI9A86lJoySC2vmGyd7a9kN2ZRFRY6N5d7ZPygH GRgA== X-Gm-Message-State: AOAM531E5pXsCZtHFwlMng68plADP796aWFl5VrIy2ozteO1JLzRewxY Gkj7rBa5kPIy+Mg0t89ykMxWvg== X-Google-Smtp-Source: ABdhPJz1Avh4HN6DQiZzqz4/rTVdV3M1dPYBBtkQj0F1g4vZ8ZuWvt50nV5zfoHWIgPSVUxv7fK0VQ== X-Received: by 2002:a6b:b555:: with SMTP id e82mr20041361iof.56.1595790608623; Sun, 26 Jul 2020 12:10:08 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id e21sm7467588ioe.11.2020.07.26.12.10.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jul 2020 12:10:07 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 0ACC8800182; Sun, 26 Jul 2020 14:10:06 -0500 (CDT) Date: Sun, 26 Jul 2020 14:10:06 -0500 From: Justin Pryzby To: vignesh C Cc: Pavel Stehule , pgsql-hackers@postgresql.org Subject: Re: proposal: possibility to read dumped table's name from file Message-ID: <20200726191006.GK4286@telsasoft.com> References: <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 Sat, Jul 25, 2020 at 06:56:31PM +0530, vignesh C wrote: > On Tue, Jul 14, 2020 at 12:03 PM Pavel Stehule wrote: > >> I meant can this: > >> printf(_(" --filter=FILENAME read object name filter > >> expressions from file\n")); > >> be changed to: > >> printf(_(" --filter=FILENAME dump objects and data based > >> on the filter expressions from the filter file\n")); > > > > done in today patch > > Thanks for fixing the comments. > Few comments: > + /* use "-" as symbol for stdin */ > + if (strcmp(filename, "-") != 0) > + { > + fp = fopen(filename, "r"); > + if (!fp) > + fatal("could not open the input file \"%s\": %m", > + filename); > + } > + else > + fp = stdin; > > We could use STDIN itself instead of -, it will be a more easier > option to understand. I think "-" is used widely for commandline tools, and STDIN is not (even though it's commonly used by programmers). For example, since last year, pg_restore -f - means stdout. -- Justin