46.11. Environment Variables

|46.11. Environment Variables|                   |                                                  |                  |                 |
|:--------------------------:|-------------------|--------------------------------------------------|------------------|-----------------|
| [Prev](plpython-util.html) |[Up](plpython.html)|Chapter 46. PL/Python — Python Procedural Language|[Home](index.html)| [Next](spi.html)|

---

## 46.11. Environment Variables

 Some of the environment variables that are accepted by the Python interpreter can also be used to affect PL/Python behavior. They would need to be set in the environment of the main PostgreSQL server process, for example in a start script. The available environment variables depend on the version of Python; see the Python documentation for details. At the time of this writing, the following environment variables have an affect on PL/Python, assuming an adequate Python version:

* `PYTHONHOME`

* `PYTHONPATH`

* `PYTHONY2K`

* `PYTHONOPTIMIZE`

* `PYTHONDEBUG`

* `PYTHONVERBOSE`

* `PYTHONCASEOK`

* `PYTHONDONTWRITEBYTECODE`

* `PYTHONIOENCODING`

* `PYTHONUSERBASE`

* `PYTHONHASHSEED`

 (It appears to be a Python implementation detail beyond the control of PL/Python that some of the environment variables listed on the `python` man page are only effective in a command-line interpreter and not an embedded Python interpreter.)

---

|[Prev](plpython-util.html)|[Up](plpython.html)|             [Next](spi.html)            |
|:-------------------------|:-----------------:|----------------------------------------:|
| 46.10. Utility Functions |[Home](index.html) | Chapter 47. Server Programming Interface|

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>