summaryrefslogtreecommitdiff
path: root/ext/pgsql/php_pgsql.h
Commit message (Collapse)AuthorAgeFilesLines
* Replace zend_bool uses with boolNikita Popov2021-01-151-1/+1
| | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Return empty array for no rows in pg_fetch_all()Nikita Popov2020-09-211-1/+1
| | | | | This makes it line up with pg_fetch_all_columns(), as well as similar functions in other exts, such as mysqli_fetch_all().
* PGSQL and POD_SQL: don't include pg_config.hChristoph M. Becker2020-05-251-7/+0
| | | | | | | | | | | | | | | | | | | | | Even if that header file is available, we better consider it private, and don't include it. The information about whether SSL support is enabled is now missing (`USE_(OPEN)SSL`), and it seems there is no alternative way to get it (`PQinitSSL()` is always defined), so we remove it from the PHP info. Furthermore, the `PG_VERSION` and `PG_VERSION_STR` macros are no longer available, but as of libpq 9.1 there is `PQlibVersion()` which allows us to construct `PG_VERSION` in a most likely backwards compatible manner. The additional information available through `PG_VERSION_STR` is lost, though, so we define `PGSQL_LIBPQ_VERSION_STR` basically as alias of `PGSQL_LIBPQ_VERSION`, and deprecate it right away. Since we are now requiring at least libpq 9.1, we can remove some further compatibility code and additional checks. Regarding the raised requirements: official support for PostGreSQL 9.0 ended on 2015-10-08, and even CentOS 7 already has PostGreSQL 9.2, so this is not supposed to be too much of an issue.
* Raise ext/pgsql requirements to PostGreSQL 7.4Christoph M. Becker2020-05-221-24/+0
| | | | | | | We can safely assume that users have at the very least libpq 7.4, for which official support ended on 2010-10-01; even CentOS 6 has 8.4 now. It is also noteworthy that PDO_PGSQL already requires libpq 7.4 or later.
* Fix [-Wundef] warning in PostgreSQL extensionGeorge Peter Banyard2020-05-201-14/+14
|
* Merge branch 'PHP-7.4'Christoph M. Becker2020-04-291-0/+1
|\ | | | | | | | | * PHP-7.4: Fix #79532: sizeof off_t can be wrong
| * Fix #79532: sizeof off_t can be wrongChristoph M. Becker2020-04-291-0/+1
| | | | | | | | | | | | | | | | | | We have to actually determine the proper `SIZEOF_OFF_T`. Interestingly, it is `4` on Windows x64. We also have to prevent the redefinition in pg_config.h. The clean solution would likely be to not include pg_config.h at all, but that's out of scope for BC reasons for now.
* | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
|/ | | | Closes GH-4732.
* Report errors from stream read and write operationsNikita Popov2019-07-221-2/+2
| | | | | | | | | | | | | | | | | | The php_stream_read() and php_stream_write() functions now return an ssize_t value, with negative results indicating failure. Functions like fread() and fwrite() will return false in that case. As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams should not be regarded as error conditions, and be reported as successful zero-length reads/writes instead. The handling of EINTR remains unclear and is internally inconsistent (e.g. some code-paths will automatically retry on EINTR, while some won't). I'm landing this now to make sure the stream wrapper ops API changes make it into 7.4 -- however, if the user-facing changes turn out to be problematic we have the option of clamping negative returns to zero in php_stream_read() and php_stream_write() to restore the old behavior in a relatively non-intrusive manner.
* Include libpq-fs.h on Windows, tooChristoph M. Becker2019-04-121-3/+1
| | | | That's more future proof than defining hard-coded macros.
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-04-101-0/+1
|\
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-04-101-0/+1
| |\
| | * Fix pgsql use after free trying to reuse closed connectionNikita Popov2019-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a connection is closed, we also need to remove the hash entry from the regular_list, as it now points to freed memory. To do this store a reverse mapping from the connection to the hash string. It would be nicer to introduce a wrapping structure for the pgsql link resource that could store the hash (and notices), but that would require large changes to the extension, so I'm going for a more minimal fix here.
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
| * | Future-proof email addressesZeev Suraski2018-11-011-1/+1
| | |
* | | Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
| | |
* | | Future-proof email addresses...Zeev Suraski2018-11-011-1/+1
| | |
* | | Fix some misspellingsGabriel Caruso2018-08-121-1/+1
|/ /
* | Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* | year++Xinchen Hui2018-01-021-1/+1
| |
* | Move constants into read-only data segmentDmitry Stogov2017-12-141-1/+1
|/
* Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|
* Merge branch 'PHP-7.0'Nikita Popov2016-03-031-1/+1
|\
| * Move semicolon into TSRMLS_CACHE_EXTERN/DEFINENikita Popov2016-03-031-1/+1
| | | | | | | | Also re bug #71575.
* | Merge branch 'PHP-7.0'Lior Kaplan2016-01-011-1/+1
|\ \ | |/ | | | | | | | | | | * PHP-7.0: Update header to PHP Version 7 Happy new year (Update copyright to 2016) Happy new year (Update copyright to 2016)
| * Merge branch 'PHP-5.6' into PHP-7.0Lior Kaplan2016-01-011-1/+1
| |\ | | | | | | | | | | | | * PHP-5.6: Happy new year (Update copyright to 2016)
| | * Happy new year (Update copyright to 2016)Lior Kaplan2016-01-011-1/+1
| | |
| | * bump yearXinchen Hui2015-01-151-1/+1
| | |
* | | Improve FR #48532 implementation (Allow pg_fetch_all() to index numerically).Yasuo Ohgaki2015-12-181-3/+2
| | | | | | | | | | | | Made result type option be consistent with pg_fetch_row().
* | | Implemented FR #48532 (Allow pg_fetch_all() to index numerically).Yasuo Ohgaki2015-12-171-2/+2
|/ /
* | switch to the unified globals accessor where appropriateAnatol Belski2015-07-291-6/+2
| |
* | cleanup mod version macros and mod defs, round xAnatol Belski2015-03-231-0/+3
| |
* | made ZEND_TSRMLS_CACHE_* macros look like function callsAnatol Belski2015-02-161-1/+1
| | | | | | | | which also comply with the current semantics for such macros
* | bump yearXinchen Hui2015-01-151-1/+1
| |
* | first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-14/+14
| |
* | converted ext/ereg, ext/phar and ext/pgsql for static tsrmls usageAnatol Belski2014-10-161-1/+4
| |
* | s/PHP 5/PHP 7/Johannes Schlüter2014-09-191-1/+1
| |
* | master renames phase 1Anatol Belski2014-08-251-9/+9
| |
* | ported ext/pgsqlAnatol Belski2014-08-191-9/+9
| |
* | Refactoring ext/pgsql (incompleted, only compilable)Xinchen Hui2014-05-191-5/+5
|/
* Support async pgsql connections and non-blocking queriesDaniel Lowrey2014-03-171-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New functions (each accepts a pgsql $connection resource): . pg_connect_poll . pg_socket . pg_consume_input . pg_flush - Modified functions The following functions now additionally return zero if the underlying socket is set to non-blocking mode and the send operation does not complete immediately. Previously these functions returned only boolean TRUE/FALSE and blocked execution while polling until all data was sent: . pg_send_execute . pg_send_prepare . pg_send_query . pg_send_query_params - New constants Used with pg_connect() to initiate an asynchronous connection attempt: . PGSQL_CONNECT_ASYNC Used with pg_connection_status() to determine the current state of an async connection attempt: . PGSQL_CONNECTION_STARTED . PGSQL_CONNECTION_MADE . PGSQL_CONNECTION_AWAITING_RESPONSE . PGSQL_CONNECTION_AUTH_OK . PGSQL_CONNECTION_SSL_STARTUP . PGSQL_CONNECTION_SETENV Used with pg_connect_poll() to determine the result of an async connection attempt: . PGSQL_POLLING_FAILED . PGSQL_POLLING_READING . PGSQL_POLLING_WRITING . PGSQL_POLLING_OK . PGSQL_POLLING_ACTIVE - Polling via returned pg_socket() stream pg_socket() returns a read-only socket stream that may be cast to a file descriptor for select (and similar) polling operations. Blocking behavior of the pgsql connection socket can be controlled by calling stream_set_blocking() on the stream returned by pg_socket().
* Imprement FR #25854 Return value for pg_insert should be resource instead of ↵Yasuo Ohgaki2014-02-171-0/+3
| | | | bool
* Implement FR #41146 - Add "description" with exteneded flag pg_meta_data().Yasuo Ohgaki2014-02-171-1/+1
| | | | | pg_meta_data(resource $conn, string $table [, bool extended]) It also made pg_meta_data() return "is enum" always.
* EXPERIMENTAL flags for pg_select/pg_insert/pg_update/pg_delete are removed.Yasuo Ohgaki2014-02-161-0/+1
| | | | | Use string escape for exotic types that allows to handle any data types. i.e. Array, JSON, JSONB, etc will work. Add escape only query for better performance which removes meta data look up. Limitations forced by pg_convert() can be avoided with this. PGSQL_DML_ESCAPE constant is added for it.
* Merge branch 'PHP-5.5' into PHP-5.6Yasuo Ohgaki2014-02-151-1/+1
|\
| * Refactor and cleanup. WS is cleaned up. Use -b if it is needed.Yasuo Ohgaki2014-02-151-1/+1
| | | | | | | | Added compatibility macros, PQescapeStringConn, PGSQLescapeLiteral/Identifier, PGSQLfree.
* | Merge branch 'PHP-5.5' into PHP-5.6Lior Kaplan2014-02-141-1/+1
|\ \ | |/
| * a few typofixesVeres Lajos2014-02-141-1/+1
| |
| * Bump yearXinchen Hui2014-01-031-1/+1
| |
| * Happy New YearXinchen Hui2013-01-011-1/+1
| |