postgresql/contrib/dblink
Tom Lane 7ca37fb040 Use setenv() in preference to putenv().
Since at least 2001 we've used putenv() and avoided setenv(), on the
grounds that the latter was unportable and not in POSIX.  However,
POSIX added it that same year, and by now the situation has reversed:
setenv() is probably more portable than putenv(), since POSIX now
treats the latter as not being a core function.  And setenv() has
cleaner semantics too.  So, let's reverse that old policy.

This commit adds a simple src/port/ implementation of setenv() for
any stragglers (we have one in the buildfarm, but I'd not be surprised
if that code is never used in the field).  More importantly, extend
win32env.c to also support setenv().  Then, replace usages of putenv()
with setenv(), and get rid of some ad-hoc implementations of setenv()
wannabees.

Also, adjust our src/port/ implementation of unsetenv() to follow the
POSIX spec that it returns an error indicator, rather than returning
void as per the ancient BSD convention.  I don't feel a need to make
all the call sites check for errors, but the portability stub ought
to match real-world practice.

Discussion: https://postgr.es/m/2065122.1609212051@sss.pgh.pa.us
2020-12-30 12:56:06 -05:00
..
expected libq support for sslpassword connection param, DER format keys 2019-11-30 15:27:13 -05:00
input Use setenv() in preference to putenv(). 2020-12-30 12:56:06 -05:00
output Use setenv() in preference to putenv(). 2020-12-30 12:56:06 -05:00
sql Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
dblink--1.0--1.1.sql Fix typo in update scripts for some contrib modules. 2013-07-19 04:13:01 +09:00
dblink--1.1--1.2.sql Fix parallel-safety markings for contrib/dblink. 2016-06-17 23:08:21 -04:00
dblink--1.2.sql Fix parallel-safety markings for contrib/dblink. 2016-06-17 23:08:21 -04:00
dblink.c Improve hash_create()'s API for some added robustness. 2020-12-15 11:38:53 -05:00
dblink.control Update dblink extension for parallel query. 2016-06-17 15:18:44 -04:00
Makefile Remove support for upgrading extensions from "unpackaged" state. 2020-02-19 16:59:14 -05:00
pg_service.conf Diagnose incompatible OpenLDAP versions during build and test. 2014-07-22 11:01:03 -04:00