pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). 7+ messages / 1 participants [nested] [flat]
* pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). @ 2020-10-28 18:36 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-10-28 18:36 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use mode "r" for popen() in psql's evaluate_backtick(). In almost all other places, we use plain "r" or "w" mode in popen() calls (the exceptions being for COPY data). This one has been overlooked (possibly because it's buried in a ".l" flex file?), but it's using PG_BINARY_R. Kensuke Okamura complained in bug #16688 that we fail to strip \r when stripping the trailing newline from a backtick result string. That's true enough, but we'd also fail to convert embedded \r\n cleanly, which also seems undesirable. Fixing the popen() mode seems like the best way to deal with this. It's been like this for a long time, so back-patch to all supported branches. Discussion: https://postgr.es/m/16688-c649c7b69cd7e6f8@postgresql.org Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/aff06436caf844877f99d32346b076a480e582a7 Modified Files -------------- src/bin/psql/psqlscan.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). @ 2020-10-28 18:36 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-10-28 18:36 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use mode "r" for popen() in psql's evaluate_backtick(). In almost all other places, we use plain "r" or "w" mode in popen() calls (the exceptions being for COPY data). This one has been overlooked (possibly because it's buried in a ".l" flex file?), but it's using PG_BINARY_R. Kensuke Okamura complained in bug #16688 that we fail to strip \r when stripping the trailing newline from a backtick result string. That's true enough, but we'd also fail to convert embedded \r\n cleanly, which also seems undesirable. Fixing the popen() mode seems like the best way to deal with this. It's been like this for a long time, so back-patch to all supported branches. Discussion: https://postgr.es/m/16688-c649c7b69cd7e6f8@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cb0982ba9796e16a0d38953c14ef32af657e6fd4 Modified Files -------------- src/bin/psql/psqlscanslash.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). @ 2020-10-28 18:36 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-10-28 18:36 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use mode "r" for popen() in psql's evaluate_backtick(). In almost all other places, we use plain "r" or "w" mode in popen() calls (the exceptions being for COPY data). This one has been overlooked (possibly because it's buried in a ".l" flex file?), but it's using PG_BINARY_R. Kensuke Okamura complained in bug #16688 that we fail to strip \r when stripping the trailing newline from a backtick result string. That's true enough, but we'd also fail to convert embedded \r\n cleanly, which also seems undesirable. Fixing the popen() mode seems like the best way to deal with this. It's been like this for a long time, so back-patch to all supported branches. Discussion: https://postgr.es/m/16688-c649c7b69cd7e6f8@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/66f8687a8ff867f656de81e367314604d29dbd59 Modified Files -------------- src/bin/psql/psqlscanslash.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). @ 2020-10-28 18:36 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-10-28 18:36 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use mode "r" for popen() in psql's evaluate_backtick(). In almost all other places, we use plain "r" or "w" mode in popen() calls (the exceptions being for COPY data). This one has been overlooked (possibly because it's buried in a ".l" flex file?), but it's using PG_BINARY_R. Kensuke Okamura complained in bug #16688 that we fail to strip \r when stripping the trailing newline from a backtick result string. That's true enough, but we'd also fail to convert embedded \r\n cleanly, which also seems undesirable. Fixing the popen() mode seems like the best way to deal with this. It's been like this for a long time, so back-patch to all supported branches. Discussion: https://postgr.es/m/16688-c649c7b69cd7e6f8@postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9eb2503391da1d0a17d3116a5a49e4f73b1af84f Modified Files -------------- src/bin/psql/psqlscanslash.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). @ 2020-10-28 18:36 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-10-28 18:36 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use mode "r" for popen() in psql's evaluate_backtick(). In almost all other places, we use plain "r" or "w" mode in popen() calls (the exceptions being for COPY data). This one has been overlooked (possibly because it's buried in a ".l" flex file?), but it's using PG_BINARY_R. Kensuke Okamura complained in bug #16688 that we fail to strip \r when stripping the trailing newline from a backtick result string. That's true enough, but we'd also fail to convert embedded \r\n cleanly, which also seems undesirable. Fixing the popen() mode seems like the best way to deal with this. It's been like this for a long time, so back-patch to all supported branches. Discussion: https://postgr.es/m/16688-c649c7b69cd7e6f8@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ba4f5413e357faac2f33cd5d22db2a21c0be7727 Modified Files -------------- src/bin/psql/psqlscanslash.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). @ 2020-10-28 18:36 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-10-28 18:36 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use mode "r" for popen() in psql's evaluate_backtick(). In almost all other places, we use plain "r" or "w" mode in popen() calls (the exceptions being for COPY data). This one has been overlooked (possibly because it's buried in a ".l" flex file?), but it's using PG_BINARY_R. Kensuke Okamura complained in bug #16688 that we fail to strip \r when stripping the trailing newline from a backtick result string. That's true enough, but we'd also fail to convert embedded \r\n cleanly, which also seems undesirable. Fixing the popen() mode seems like the best way to deal with this. It's been like this for a long time, so back-patch to all supported branches. Discussion: https://postgr.es/m/16688-c649c7b69cd7e6f8@postgresql.org Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/204d779695607eae5c6c0fa314516201b0af357f Modified Files -------------- src/bin/psql/psqlscanslash.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). @ 2020-10-28 18:36 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2020-10-28 18:36 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use mode "r" for popen() in psql's evaluate_backtick(). In almost all other places, we use plain "r" or "w" mode in popen() calls (the exceptions being for COPY data). This one has been overlooked (possibly because it's buried in a ".l" flex file?), but it's using PG_BINARY_R. Kensuke Okamura complained in bug #16688 that we fail to strip \r when stripping the trailing newline from a backtick result string. That's true enough, but we'd also fail to convert embedded \r\n cleanly, which also seems undesirable. Fixing the popen() mode seems like the best way to deal with this. It's been like this for a long time, so back-patch to all supported branches. Discussion: https://postgr.es/m/16688-c649c7b69cd7e6f8@postgresql.org Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/504f963f76f0a5867b12cba8802e858cbfa53af9 Modified Files -------------- src/bin/psql/psqlscanslash.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2020-10-28 18:36 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-10-28 18:36 pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). Tom Lane <tgl@sss.pgh.pa.us> 2020-10-28 18:36 pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). Tom Lane <tgl@sss.pgh.pa.us> 2020-10-28 18:36 pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). Tom Lane <tgl@sss.pgh.pa.us> 2020-10-28 18:36 pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). Tom Lane <tgl@sss.pgh.pa.us> 2020-10-28 18:36 pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). Tom Lane <tgl@sss.pgh.pa.us> 2020-10-28 18:36 pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). Tom Lane <tgl@sss.pgh.pa.us> 2020-10-28 18:36 pgsql: Use mode "r" for popen() in psql's evaluate_backtick(). Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox