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.92) (envelope-from ) id 1jGD5l-0003xm-48 for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Mar 2020 02:45:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jGD5j-0002Qh-El for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Mar 2020 02:45:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jGD5j-0002QN-2j for pgsql-bugs@lists.postgresql.org; Mon, 23 Mar 2020 02:45:27 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jGD5T-0004ST-ME for pgsql-bugs@lists.postgresql.org; Mon, 23 Mar 2020 02:45:25 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1jGD5R-0004aU-51; Sun, 22 Mar 2020 22:45:09 -0400 Date: Sun, 22 Mar 2020 22:45:09 -0400 From: Bruce Momjian To: jim_gray@cox.net, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16304: ECPG won't accept input from STDIN Message-ID: <20200323024509.GD2031@momjian.us> References: <16304-c662b00a1322db7f@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16304-c662b00a1322db7f@postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Mar 16, 2020 at 08:48:22PM +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 16304 > Logged by: James Gray > Email address: jim_gray@cox.net > PostgreSQL version: 11.5 > Operating system: AIX > Description: > > On an older version (9.6.3) of Postgres on CentOS 7.7.1908, ECPG accepts > input from STDIN: > > [singha7] (jgray) ~> psql --version > psql (PostgreSQL) 9.6.3 > [singha7] (jgray) ~> > > [singha7] (jgray) ~> ecpg -o - - > /* Processed by ecpg (4.12.0) */ > /* These include files are added by the preprocessor */ > #include > #include > #include > /* End of automatic include section */ > > #line 1 "stdin" > ^C > [singha7] (jgray) ~> > > On a newer version (11.5) of Postgres on AIX 7.2, ECPG does NOT accept input > from STDIN: > > bash-5.0$ psql --version > psql (PostgreSQL) 11.5 > bash-5.0$ > > bash-5.0$ ecpg -o - - > Try "ecpg --help" for more information. > bash-5.0$ > > I suspect a problem in the Postgres version of getopt_long.c Yeah, you might be right. In some cases we use the libc (maybe GNU) getopt-long, and in other cases we use our own version, and there are behavioral differences between the two. The fact you are testing on CentOS and the other on AIX probably explains it. I think using /dev/stdin should work on both. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +