dependabot[bot]
dcb302493a
build(deps): bump pypa/cibuildwheel from 2.22.0 to 2.23.2
...
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel ) from 2.22.0 to 2.23.2.
- [Release notes](https://github.com/pypa/cibuildwheel/releases )
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md )
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.22.0...v2.23.2 )
---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2025-04-02 12:45:46 +01:00
Daniele Varrazzo
5509e01108
Merge pull request #1755 from bwoodsend/fix-macos-deployment-target
...
ci(macos): Avoid linking against Homebrew
2025-01-06 01:15:51 +01:00
Daniele Varrazzo
6cd0fbdc49
fix(macos): don't crash on undefined variable
2025-01-05 22:00:24 +01:00
Daniele Varrazzo
cee23d83e0
chore(macos): drop unneeded gettext from libpq building
2025-01-05 21:37:12 +01:00
Daniele Varrazzo
5bfba4c961
refactor: use pushd/popd instead of cd
2025-01-05 21:37:12 +01:00
Daniele Varrazzo
b943457896
test: drop brew curl to use the system one
2025-01-05 21:37:12 +01:00
Brénainn Woodsend
d0bc154f31
build(macos): Enable cross compiling libpq across macOS architectures
...
The GitHub Actions runners look like they're only 1 year away from the
last macOS x86_64 platform being removed. Get ahead of the game and
build x86_64 on arm64.
2025-01-05 20:44:25 +01:00
Daniele Varrazzo
1eac4fd4da
test(macos): soften tests to account for macOS polling differences
2025-01-05 04:00:47 +01:00
Daniele Varrazzo
c8abc5ce61
ci(macos): no fast tests on macOS package building
...
We don't run complete tests in CI, so let's not waste this chance. The
overhead for complete tests is minimal compared to all the pipeline
boilerplate.
2025-01-05 04:00:00 +01:00
Daniele Varrazzo
65626ec565
ci(macos): add libpq build caching
2025-01-05 04:00:00 +01:00
Daniele Varrazzo
310bc75532
ci(macos): move libpq build script to BEFORE_ALL build step
...
This is is how it is organised in Linux.
2025-01-05 04:00:00 +01:00
Brénainn Woodsend
d43e5fe092
ci(macos): Avoid linking against homebrew
...
Homebrew binaries are always compiled for exactly the version they're
installed on making them very un-portable. When a wheel is "repaired" by
cibuildwheel, delocate-wheel pulls in _psycopg's dependencies
(libpq.dylib, libssl.dylib and libcrypto.dylib) which, on a GitHub
Actions macOS 14 runner, are provided by Homebrew and are therefore only
macOS >= 14 compatible. The resultant wheel is therefore incompatible
with all but the latest macOS versions.
Build all dependencies from source so that we can set the deployment
target to something sensible. Fixes #1753 .
2025-01-04 21:23:15 +01:00
Daniele Varrazzo
3b684f91ca
ci: rename merged artifact package
...
It doesn't contain binary packages only
2025-01-04 21:06:33 +01:00
dependabot[bot]
bf7fc6cfa4
build(deps): bump peter-evans/repository-dispatch from 2 to 3
...
Bumps [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch ) from 2 to 3.
- [Release notes](https://github.com/peter-evans/repository-dispatch/releases )
- [Commits](https://github.com/peter-evans/repository-dispatch/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: peter-evans/repository-dispatch
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2025-01-04 21:05:08 +01:00
Daniele Varrazzo
979d56a797
chore: update cibuildwheel to 2.22.0
2025-01-04 21:04:14 +01:00
dependabot[bot]
4903f1c5d6
build(deps): bump actions/cache from 3 to 4
...
Bumps [actions/cache](https://github.com/actions/cache ) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases )
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md )
- [Commits](https://github.com/actions/cache/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2025-01-04 21:02:30 +01:00
Daniele Varrazzo
1dc7b5b70b
ci: add merge step to download all packages at once
2025-01-04 21:01:09 +01:00
Daniele Varrazzo
ed4ba11d17
Merge pull request #1772 from psycopg/ci-vcpkg
...
Package psycopg2-binary for windows using vcpkg libpq
2025-01-04 21:00:44 +01:00
Daniele Varrazzo
947f731400
ci: test against final Python 3.13
2025-01-04 19:06:56 +01:00
Daniele Varrazzo
b8d49e6280
test: skip module test on Windows
...
Life is too short to figure out why it fails.
2025-01-04 19:06:56 +01:00
Daniele Varrazzo
4dfa680a71
ci(macos): use the macos-13 runners
...
macos-12 is not supported anymore.
2025-01-04 19:06:56 +01:00
Daniele Varrazzo
f4282c6d87
chore: drop Postgres version parsing in setup.py
...
The macro is in the include files, no idea why parsing it from pg_config
was needed.
2025-01-04 19:06:56 +01:00
Daniele Varrazzo
a8765121d9
fix(ci): handle other pg_config options required by setup.py
2025-01-04 19:06:56 +01:00
Daniele Varrazzo
bb52bcf769
ci(windows): create the psycopg2-binary package in Github
2025-01-04 19:06:56 +01:00
Daniele Varrazzo
fa24c922e7
ci(windows): build binary packages using the vcpkg package
2025-01-04 19:06:56 +01:00
Daniele Varrazzo
3c7889b0e7
chore: drop appveyor CI integration
2025-01-04 19:06:56 +01:00
Daniele Varrazzo
e83754a414
ci: work around the envionment breaking guard
2024-10-15 13:49:08 +02:00
Daniele Varrazzo
a805acf59f
chore: bump to version 2.9.10
2024-10-15 10:40:56 +02:00
Daniele Varrazzo
78561ac99d
Merge pull request #1728 from romank0/fetch-notifications-on-commit
...
Adds notifies processing during commit
2024-10-11 03:13:56 +02:00
Daniele Varrazzo
5283a835dc
chore: add TransactionTimeout error, added in PostgreSQL 17
...
Url to fetch source changed from the official Postgres one to the Github
mirror because the former throttled us.
2024-10-11 02:41:31 +02:00
Daniele Varrazzo
f64dd397fd
docs: add news entry about notifications on commit
2024-10-11 00:29:28 +02:00
Roman Konoval
cba6d39be0
removes duplication in tests
2024-10-11 00:26:05 +02:00
Roman Konoval
282360dd04
adds notifications processing after every PQexec
2024-10-11 00:26:05 +02:00
Roman Konoval
362cb00978
Adds notifies processing in pq_commit
2024-10-11 00:24:37 +02:00
Daniele Varrazzo
eaeeb76944
Merge pull request #1729 from edgarrmondragon/1692-py313-wheels
...
Build Python 3.13 wheels, drop support for Python 3.7
2024-10-11 00:17:47 +02:00
Daniele Varrazzo
4987362fb4
ci(windows): drop Python 3.8 packages
...
The runner image to build 3.8 package doesn't seem to have a currently
supported database, and the previously used 9.6 is no more supported on
current runners.
2024-10-10 15:48:48 +02:00
Daniele Varrazzo
8c9a35de38
ci: test with PostgreSQL 17
2024-10-09 19:46:48 +02:00
Daniele Varrazzo
563b55a725
docs: bump supported versions to Python 3.13 and Postgres 17
2024-10-08 17:08:02 +02:00
Daniele Varrazzo
dac8fa5632
ci(win): use PostgreSQL 13 for tests
...
By latest errors, it seems that Postgres 9.6 is no more supported on
VS2019 image. By documentation, it also seem that Postgres 13 is the
most recent supported database and not available in VS2015 image.
Therefore, drop Python 3.8 test (and likely build).
See https://www.appveyor.com/docs/services-databases/#postgresql
2024-10-08 17:04:40 +02:00
Edgar Ramírez-Mondragón
e1cf23d9c7
Drop Python 3.7 in other places
2024-10-05 01:41:20 -06:00
Edgar Ramírez-Mondragón
0eccfbec47
Ensure pg data dir exists
2024-10-05 01:35:47 -06:00
Edgar Ramírez-Mondragón
26f0f13b39
Use py
executable in appveyor
2024-10-05 01:29:06 -06:00
Edgar Ramírez-Mondragón
a59079a4f2
Build Python 3.13 wheels
2024-10-04 22:40:03 -06:00
Anoosh Dsouza
f9780aa054
fixed a typo in doc/src/usage.rst file
2024-09-19 20:56:05 +02:00
0xTiger
658afe4cd9
docs: tiny grammar fix "a" -> "one"
2024-07-17 18:44:43 +02:00
Daniele Varrazzo
f79867c9f2
chore: bump to next dev version
2024-07-14 22:01:17 +02:00
Daniele Varrazzo
dc5249ba01
Merge pull request #1695 from befeleme/py3.13
...
Add support for Python 3.13
2024-07-14 21:58:10 +02:00
Daniele Varrazzo
7c2706a8b4
docs: note Python 3.13 support in news file
2024-07-14 21:57:27 +02:00
Karolina Surma
4a4b5acdc2
Declare the support for Python 3.13 in classifiers
2024-04-26 09:21:05 +02:00
Karolina Surma
efc5ad01e0
Add Python 3.13.0a6 to tox matrix
2024-04-26 09:21:05 +02:00
Karolina Surma
866bcef589
Add Python 3.13.0a6 to CI
2024-04-26 09:21:05 +02:00
Karolina Surma
3b9aa7cf9f
Fix tests with Python 3.13
...
The textual representation of addresses has changed, adapt the code to
expect different values on Python 3.13+.
See: https://github.com/python/cpython/commit/f22bf8e3cf899896cf587099d292
2024-04-24 10:15:54 +02:00
Karolina Surma
829a7a2be9
_PyInterpreterState_Get() has become public in Python 3.13
...
Since 3.13.0a1 it has been renamed to PyInterpreterStateGet()
Source: https://github.com/python/cpython/pull/106321
2024-04-24 10:15:50 +02:00
Nick Zandbergen
a971c11d50
Update lobject_type.c
...
Add bytes as accepted input for documentation
2024-02-15 22:26:05 +00:00
dependabot[bot]
00870545b7
build(deps): bump actions/setup-python from 4 to 5
...
Bumps [actions/setup-python](https://github.com/actions/setup-python ) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases )
- [Commits](https://github.com/actions/setup-python/compare/v4...v5 )
---
updated-dependencies:
- dependency-name: actions/setup-python
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 03:27:05 +00:00
dependabot[bot]
bf45060074
build(deps): bump actions/upload-artifact from 3 to 4
...
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact ) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases )
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 03:26:43 +00:00
Daniele Varrazzo
5fb59cd6ee
Merge branch 'macos-arm64-py312'
2023-11-01 11:45:52 +01:00
Daniele Varrazzo
e0d1daf290
Merge branch 'wheel-312-win'
2023-11-01 11:45:35 +01:00
Rene Leonhardt
941ac9a724
chore: add support for Python 3.12 macOS arm64 wheels
2023-11-01 11:33:30 +01:00
Rene Leonhardt
4e473010a3
chore: let dependabot update GitHub actions
2023-10-30 09:19:50 +00:00
Rene Leonhardt
8947b00142
chore: update GitHub actions and Postgres image tags
2023-10-29 18:05:30 +00:00
Daniele Varrazzo
46191f1fde
ci(windows): add Python 3.12 to the testing grid
2023-10-28 11:41:40 +02:00
Daniele Varrazzo
e73d2fa9f0
ci(win32): install the setuptools package to build in appveyor
...
Present so far, it wasn't installed in the first image containing Python 3.12.
2023-10-28 01:57:56 +02:00
Daniele Varrazzo
89005ac5b8
docs: add README blurb pointing to psycopg 3 on PyPI
...
See #1632 .
2023-10-10 23:35:40 +02:00
Panagiotis H.M. Issaris
bfdffc2c57
chore: show a Changelog link on PyPI
2023-10-06 15:05:42 +01:00
Daniele Varrazzo
ad5bee7054
chore: bump version number to 2.9.9
2023-10-03 11:39:35 +02:00
Daniele Varrazzo
37d1de1c8f
chore: add support for Python 3.12
2023-10-03 11:39:35 +02:00
Daniele Varrazzo
abf2723c0a
chore: drop support for Python 3.6
2023-10-03 11:39:35 +02:00
Daniele Varrazzo
2da65a715c
chore: drop leftover Python 2.7 import aliases from setup.py
2023-10-03 11:39:35 +02:00
Daniele Varrazzo
3fa60fd268
chore: bump doc requirement complained by dependabot
2023-10-03 11:39:32 +02:00
Daniele Varrazzo
1c1484e43b
ci: better interaction with scaleway build server
2023-10-03 11:39:32 +02:00
Daniele Varrazzo
c81cec604f
chore: bump to next dev release
2023-10-03 11:20:17 +02:00
Daniele Varrazzo
7fe8cb77ca
chore: bump docs requirements dependabot complains about
2023-09-28 09:29:21 +02:00
Daniele Varrazzo
b39d5d6492
chore: bundle libpq 16
...
- https://github.com/psycopg/psycopg/issues/650
- https://github.com/psycopg/psycopg/discussions/528
2023-09-28 09:26:33 +02:00
Daniele Varrazzo
921510d5be
docs: replace "compiled against" with "bundled with" in news file
...
Less confrontational...
2023-09-28 09:22:08 +02:00
Daniele Varrazzo
999d7a6d01
test: skip ssl test if libpq runtime > 16
...
Close #1619
2023-09-11 16:11:07 +01:00
Daniele Varrazzo
3eee3e336d
ci: fix passing env vars to build scripts
2023-08-04 17:28:24 +01:00
Daniele Varrazzo
1e0086b1fe
chore: bump version to 2.9.7
2023-08-04 17:22:46 +01:00
Daniele Varrazzo
4fe28d661a
Merge branch 'dev/init-failure'
2023-08-04 17:20:50 +01:00
Daniele Varrazzo
14e06d8185
docs: mention module init errors fix in news file
2023-08-04 17:20:02 +01:00
Jacob Champion
959339cefb
Return NULL on failed module initialization
...
Previously, any exceptions raised during initialization were swallowed
with a message like
SystemError: initialization of _psycopg raised unreported exception
Fixes #1598 .
2023-08-04 17:19:58 +01:00
Daniele Varrazzo
fb77bdca0b
Merge branch 'dev/fix-meson-build'
2023-08-04 17:19:41 +01:00
Daniele Varrazzo
ef7053c070
docs: add pg_config improvement to news file
2023-08-04 17:18:59 +01:00
Jacob Champion
ea71fbcd46
setup.py: handle more corner cases for pg_config
...
- Differentiate between unexpected empty values and execution failure.
- Accept empty --cppflags and --ldflags output. Fixes #1599 .
- Accept UTF-8 output from pg_config, for alternative client locales.
2023-08-04 17:18:56 +01:00
Daniele Varrazzo
0c5b5f4ec3
chore: bump cibuildwheel version to 2.14.1
2023-08-04 17:18:17 +01:00
Daniele Varrazzo
20fcfd6786
chore: upgrade libpq and openssl versions used in packaging
2023-08-04 17:18:17 +01:00
Xing Guo
329f43c762
Use except psycopg2.Error as e
in example.
2023-07-27 10:09:03 +01:00
Daniele Varrazzo
9f020124f8
docs: don't show objects in side bar
...
Too wide, too ugly, useless to navigate.
Close #1587
2023-06-07 12:09:12 +02:00
Christoph Berg
8b17e218be
Disable test_ssl_attribute on PG16+
...
PG15 changed the semantics of some ssl attributes (#1506 ), and a very
similar regression test failure has now been observed again with PG16.
Disable the test for now.
2023-05-29 17:42:42 +02:00
Brent Wilkins
c96f991a8d
Updated from deprecated license_file parameter
2023-05-25 19:01:27 +02:00
Amirsoroush
3450d159b5
fix typo in Usage.html page in documentation
2023-04-23 22:47:26 +02:00
Daniele Varrazzo
5108191aa5
chore: upgrade docs build dependencies
2023-04-17 20:11:47 +02:00
Daniele Varrazzo
638be85eb6
docs: drop use of print statement, use the print() function instead
...
Close #1556
2023-04-17 20:07:17 +02:00
Daniele Varrazzo
0b01ded426
ci: drop github download script
...
Easier to do interactively, now that all the artifacts are packaged in
the same archive.
2023-04-03 05:10:36 +02:00
Daniele Varrazzo
46238ba351
ci: fix cache key by setting lib versions in job env
2023-04-03 05:07:01 +02:00
Daniele Varrazzo
51dd59ef9d
chore: drop Python 3.6 from Windows packages
2023-04-03 05:06:13 +02:00
Daniele Varrazzo
333b3b7ac4
ci: use cibuildwheel to build linux wheel packages
2023-04-02 17:56:29 +02:00
Daniele Varrazzo
7a8f4d6222
chore: bump version to 2.9.6
2023-04-02 13:00:38 +02:00
Daniele Varrazzo
b747b5b0fd
ci: bundle all build artifacts in a single directory
2023-04-02 12:59:29 +02:00
Daniele Varrazzo
1781e8b2c9
build: package openssl 1.1.1t with binary packages
2023-04-02 12:47:29 +02:00
Daniele Varrazzo
fdb204b4e3
docs: mention manylinux2014 packages in news file
2023-04-02 12:47:25 +02:00
Daniele Varrazzo
09b82e4094
ci: bump qemu action version to drop node deprecation warning
2023-03-30 17:09:23 +02:00
Daniele Varrazzo
97df29a312
ci: build macOS packages using cibuildwheel
...
Close #1558 .
2023-03-30 13:31:30 +02:00
Daniele Varrazzo
daeec37fab
Merge pull request #1545 from AmirBitaraf/aarch64_manylinux2014_libpq
...
Move to manylinux2014 for aarch64, ppc64le builds.
2023-03-27 17:11:28 +02:00
Amir Bitaraf
c0666b0935
Modify LD_LIBRARY_PATH to support all architectures
2023-03-26 18:35:00 +01:00
Amir Bitaraf
cc21faa4f4
Move to manylinux2014 for aarch64, ppc64le builds.
2023-03-26 18:35:00 +01:00
Daniele Varrazzo
63947e2552
ci: drop test on Python 3.6
...
The image is not available anymore
2023-02-25 16:07:21 +01:00
Daniele Varrazzo
52df8371f3
ci: pin tox to v3
...
Not interested in fixing incompatibility changes.
2023-02-25 16:05:14 +01:00
Daniele Varrazzo
feeb989323
docs: use https url in license file
...
Close #1549 .
2023-02-25 15:36:35 +01:00
Daniele Varrazzo
e8d92b74fd
Merge branch 'py311-win32'
2022-11-07 23:42:28 +01:00
Daniele Varrazzo
026b5bf3ab
ci: re-enable builds suspended for build win32 packages for Python 3.11
2022-11-07 23:41:50 +01:00
Daniele Varrazzo
02b5e226f4
ci: build packages for Python 3.11 for Workgroup... for Windows!
2022-11-07 22:38:07 +01:00
Daniele Varrazzo
57009707b1
ci: Test Python 3.11 on Appveyor
2022-11-07 22:32:56 +01:00
Daniele Varrazzo
3182ea2303
ci: adapt macOS arm64 build script to changes in Python 3.11 and PostgreSQL 15
2022-10-27 00:41:09 +02:00
Daniele Varrazzo
ea32730a39
Merge branch 'build-macos-py311'
2022-10-27 00:40:23 +02:00
Daniele Varrazzo
deb00e5454
ci: re-enable builds suspended to build macOS packages for Python 3.11
2022-10-27 00:39:11 +02:00
Daniele Varrazzo
8c824d0e47
Build packages for macOS x86_64 Python 3.11
...
The required images weren't available at the time of building the other
packages. See #1514 .
The changeset includes temporary changes to skip other builds. They will
be reverted before merging.
2022-10-27 00:28:04 +02:00
Daniele Varrazzo
1bf8e77ea2
chore: remove macOS 3.11 build from build grid
...
Not available yet on Github: see build failure at
https://github.com/psycopg/psycopg2/actions/runs/3320363567/jobs/5486654852
2022-10-25 13:34:29 +02:00
Daniele Varrazzo
af3ee06ec0
chore: upgrade Github action versions
2022-10-25 13:04:28 +02:00
Daniele Varrazzo
963fb1190b
chore: fix yaml syntax in Github Action workflow
2022-10-25 12:59:23 +02:00
Daniele Varrazzo
27a99dac72
chore: bump version number to release 2.9.5
2022-10-25 12:55:57 +02:00
Daniele Varrazzo
78690cfaf8
lint: reformat appveyor yaml
2022-10-25 12:54:34 +02:00
Daniele Varrazzo
259d15ae3e
chore: build binary packages with OpenSSL 1.1.1q
2022-10-25 12:47:46 +02:00
Daniele Varrazzo
77039cad63
chore: fix directory where to find binary package after build
2022-10-25 12:47:02 +02:00
Daniele Varrazzo
e6e465c509
chore: build binary packages using libpq from PostgreSQL 15
...
fix #1497 as a side effect of using libpq 15.
2022-10-25 12:47:02 +02:00
Daniele Varrazzo
12700a5f02
Build packages for Python 3.11
2022-10-25 12:37:23 +02:00
Daniele Varrazzo
271dd1fce7
chore: move cache_rebuild file into appveyor dir
2022-10-25 12:24:10 +02:00
Daniele Varrazzo
e4b2a197c6
chore: bump to next dev version
2022-10-25 12:20:46 +02:00
Daniele Varrazzo
20bb486663
Merge branch 'doc_examples_executemanybatch'
2022-10-20 21:33:46 +02:00
Daniele Varrazzo
f401d0b738
docs: fix reST syntax and whitespace in executemany examples
2022-10-20 21:31:18 +02:00
Ion Alberdi
4912be0e7f
[test_basic_types] Add test for array[%s] on NULL arrays
...
Add test to verifity the fix for #1507 .
2022-10-11 13:02:22 +01:00
Hannes
aabac5df31
Add executemany & execute_batch examples
2022-10-10 19:08:46 +02:00
Daniele Varrazzo
a12dbc4357
docs: fix typos in release notes
2022-10-06 03:58:50 +01:00
Daniele Varrazzo
bc82c8f9cc
fix: set default SYSCONFDIR to the quasi-standard /etc/postgresql-common
...
Fix #1365 .
2022-10-06 03:49:25 +01:00
Daniele Varrazzo
c38aa27d7d
chore: bump version number to release 2.9.4
2022-10-06 03:32:17 +01:00
Daniele Varrazzo
bd96594e2d
docs: add link to release notes page to find which Python version is supported
...
Close #1418 .
2022-10-06 03:27:40 +01:00
Daniele Varrazzo
182a51a33f
chore: upgrade packaged libpq version and dependencies
...
appveyor.cache_rebuild reformatted for greppability.
2022-10-06 03:27:40 +01:00
Daniele Varrazzo
76b703e910
Merge branch 'pg15'
2022-10-06 02:59:28 +01:00
Daniele Varrazzo
29a65f756c
chore: upgrade error codes to PostgreSQL 15
2022-10-06 02:26:09 +01:00
Daniele Varrazzo
6d815f5df9
test: adapt ssl test to libpq 15
...
See #1506 , PostgreSQL bug 17625
(https://www.postgresql.org/message-id/17625-fc47c78b7d71b534%40postgresql.org )
2022-10-06 02:09:19 +01:00
Daniele Varrazzo
c7326f8da7
test: add PostgreSQL 15 to the test grid
2022-10-06 02:09:19 +01:00
Daniele Varrazzo
68d786b610
Merge branch 'fix-1487'
2022-10-06 02:09:06 +01:00
Daniele Varrazzo
7054e1aadf
test: add test to verify register_range() with names requiring escape
...
Unlike for register_composite(), this works already.
2022-10-06 02:05:49 +01:00
Daniele Varrazzo
ac25d3bdc0
fix: look up for range types defined in schemas in the search path
2022-10-06 02:05:39 +01:00
Daniele Varrazzo
9535462ce9
fix: correctly handle composites with names or schema requiring escape
2022-10-06 01:56:28 +01:00
Daniele Varrazzo
d88e4c2a3c
fix: handle types in the search path in register_composite()
...
Fix #1487 .
2022-10-06 01:10:07 +01:00
Daniele Varrazzo
31a80410db
chore: bump to next dev release
2022-10-06 00:21:27 +01:00
Daniele Varrazzo
d6c81b4ff0
docs: mention MacOS ARM wheel support
2022-10-05 19:48:04 +01:00
Magnus Watn
c6f30880a2
Remove Apple M1 bullet point from issue template
...
https://github.com/psycopg/psycopg2/issues/1286 is now closed.
2022-10-03 10:09:46 +01:00
Daniele Varrazzo
e3664380c4
build: fix starting Postgres in macOS build script
...
The brew command fails with:
Could not enable service: 125: Domain does not support specified action
Error: Failure while executing; `/bin/launchctl enable gui/501/homebrew.mxcl.postgresql@14` exited with 125.
2022-09-25 02:49:16 +01:00
Daniele Varrazzo
fdf957dcbd
build: use "latest" version of github builders
2022-09-25 02:46:21 +01:00
Nikita Sobolev
3e7bb8d1aa
Remove __nonzero__
method
2022-07-30 14:03:10 +02:00
Tim Tisdall
07c83ef8bb
Link to the right PR for adding alpine wheels
2022-07-28 14:39:33 +02:00
Daniele Varrazzo
f07b3ad0a6
Merge branch 'build-macos-arm64'
2022-07-28 13:30:32 +02:00
Daniele Varrazzo
611c610041
docs: fixed quote_ident() example
...
Close #1481
2022-07-27 02:54:17 +02:00
Daniele Varrazzo
25c40f8ac3
build: add scripts to build macOS arm64 packages
2022-07-17 00:20:08 +01:00
Daniele Varrazzo
ba92a22bc9
test: drop test table if exist
...
It might be a residue of a psycopg 3 test run in the same db.
2022-07-16 23:58:43 +01:00
Rafi Shamim
3c58e96e10
Unskip tests that work on CockroachDB v22.1
...
CockroachDB supports named cursors in v22.1, so more tests pass.
2022-03-28 20:26:23 +02:00
Daniele Varrazzo
626078388a
Use pip-tools to create the requirement file to build the docs
...
Docs building just broke. The requirement file had some version upper
boundary that caused problems between Sphinx and jinja2.
2022-03-26 02:45:40 +01:00
Daniele Varrazzo
c34bf2f2f9
Bump to release 2.9.3
2021-12-29 13:48:23 +01:00
Daniele Varrazzo
94ba06748f
Merge branch 'musllinux'
2021-12-29 13:36:25 +01:00
Peter Lithammer
c5528da2dc
Mention Alpine/musl wheels in news file
2021-12-10 17:21:34 +01:00
Peter Lithammer
2dc137975a
Build musllinux
wheels
2021-12-10 17:21:34 +01:00
Daniele Varrazzo
bc79abace1
Bump to next dev release
2021-12-10 14:28:04 +01:00
Daniele Varrazzo
846ae52ab2
Create parent directories too in artifacts download
2021-12-10 14:26:06 +01:00
Daniele Varrazzo
217f4120ca
Strip debug symbols from binary packages
...
The _psycopg.so library goes down from 1.6mb to 300k in Linux packages.
2021-12-10 14:26:06 +01:00
John Vandenberg
4d4d2bc444
Include sys/time.h for gettimeofday
...
Fixes https://github.com/psycopg/psycopg2/issues/1397
2021-12-03 11:29:39 +01:00
John Vandenberg
4b637ec34a
PyPy does not have PyDateTime_TimeZone_UTC
...
Fixes https://github.com/psycopg/psycopg2/issues/1398
2021-12-03 11:29:21 +01:00
Will Thompson
53bda13afa
Fix typo in large object usage documentation
2021-11-21 16:10:42 +01:00
Daniele Varrazzo
8ef195f2ff
Bump version number to release 2.9.2
2021-11-11 21:16:12 +01:00
Daniele Varrazzo
1b013b529b
Merge branch 'py311'
2021-11-11 21:14:28 +01:00
Daniele Varrazzo
0a4a469669
Mention Python 3.11 preliminary support in the newsfile.
2021-11-11 21:13:38 +01:00
Cyril Jouve
5fb1305a14
support for python 3.11
2021-11-11 21:13:38 +01:00
Daniele Varrazzo
898cbff5a6
Build binary packages against PosgtgreSQL 14.1 lipq
...
Close #1388 .
2021-11-11 21:11:59 +01:00
Daniele Varrazzo
7dd193a7f7
errorcodes map and errors classes updated to PostgreSQL 14.
2021-11-11 20:08:39 +01:00
Daniele Varrazzo
1a0c02a6f4
Raise an error for dates > 10K instead of returning Y9999
...
Close #1307 .
2021-11-11 20:01:14 +01:00
Daniele Varrazzo
1454b14ae0
Fix Python 3.10 and PostgreSQL 14 compatibility notes
2021-11-05 18:37:58 +01:00
Daniele Varrazzo
8e186dd7e9
Merge branch 'py310'
2021-11-03 14:18:09 +01:00
Daniele Varrazzo
7236a1f851
Fix f-string in Appveyor package download script
2021-11-03 14:16:38 +01:00
Daniele Varrazzo
63d30aa397
Add Python 3.10 to Appveyor test grid
2021-11-03 14:16:38 +01:00
Daniele Varrazzo
6b80bd0648
Drop Windows exe package build
2021-11-03 14:16:38 +01:00
Daniele Varrazzo
5a96021612
Fix issue template markup
2021-10-30 22:57:12 +02:00
Daniele Varrazzo
4a46aa39a5
Build Python 3.10 packages of relase 2.9.1
2021-10-11 23:32:30 +02:00
Daniel Saxton
3430dcdee6
Fix doc typo
2021-09-22 12:56:08 +01:00
Daniele Varrazzo
1b255b7dc3
Fix up-date-date typo
...
Close #1336
2021-08-07 20:53:54 +01:00
Daniele Varrazzo
52c4d6fad4
Add psycopg version to issue templates
2021-07-17 14:26:54 +02:00
Daniele Varrazzo
ee3a069f1d
Maintainer email fixed
...
gmail.org!
2021-07-16 14:50:08 +02:00
Daniele Varrazzo
9cfe80ea55
Drop unwanted issue template
2021-07-14 12:22:58 +02:00
Daniele Varrazzo
64b159676f
Add issue templates
2021-07-14 12:22:00 +02:00
Daniele Varrazzo
8fe9861df5
Add docs anchor to reach the 'with' statement from psycopg3 docs
2021-07-14 02:32:22 +02:00
Daniele Varrazzo
39f12bbfc5
Don't build .exe packages anymore
2021-06-30 14:52:27 +01:00
Daniele Varrazzo
47b93efcf8
Note in the docs that now the table and fields names are escaped.
2021-06-17 16:52:44 +01:00
Daniele Varrazzo
7749898a94
Drop script to update docs on travis
2021-06-17 13:37:20 +01:00
Daniele Varrazzo
46bc175cc7
Trigger docs update to the website build workflow on GitHub Action
2021-06-17 12:54:36 +01:00
Daniele Varrazzo
dd9c6659bc
Fix building docs for the website
2021-06-17 03:54:14 +01:00
Daniele Varrazzo
62490a6bcc
Allow to specify the build to download from Appveyor
2021-06-17 03:54:14 +01:00
Daniele Varrazzo
c59ff6a4b7
Don't require the virtualenv binary to build the docs
2021-06-17 01:42:42 +01:00
Daniele Varrazzo
b241def64b
Fix representation of sql.Placeholder
...
Fix also Placeholder tests, including an error which made an assert
always true, which made us miss the regression in #1291 .
2021-06-17 00:28:14 +01:00
Daniele Varrazzo
2df79c5a5f
Bump version number to 2.9.1
2021-06-17 00:06:04 +01:00
Daniele Varrazzo
dd2ff2af56
Fix regression with named sql.Placeholder
...
Close #1291 .
2021-06-16 23:56:05 +01:00
Daniele Varrazzo
b46424447f
Bump to next dev release
2021-06-16 23:56:05 +01:00
Daniele Varrazzo
bab166e2c1
Fix spelling in news file
2021-06-16 17:08:06 +01:00
Daniele Varrazzo
c5aa98d8bc
Add note about cursor.callproc() and PostgreSQL procedures
...
Close #1155
2021-06-16 16:51:13 +01:00
Daniele Varrazzo
cbbf195a23
Tweak package paths in release docs
2021-06-16 16:38:12 +01:00
Daniele Varrazzo
2b7383c9f9
Build docs from the master branch
2021-06-16 16:37:59 +01:00
Daniele Varrazzo
50145014e8
Bump to versio 2.9
2021-06-16 13:28:31 +01:00
Daniele Varrazzo
9ac54b3615
Move appveyor build support to the scripts/build dir
2021-06-15 18:57:22 +01:00
Daniele Varrazzo
f5d6366287
Rename the github package download script for consistency
2021-06-15 18:54:45 +01:00
Daniele Varrazzo
bbc5fd3180
Drop obsolete file to build Windows packages
2021-06-15 18:42:25 +01:00
Daniele Varrazzo
9e5847222d
Upgrade libpq to 13.3 and libssl to 1.1.1k on windows too
2021-06-15 18:42:25 +01:00
Daniele Varrazzo
cefb818105
Build manylinux2014 packages for i686/x86_64 platforms
...
The manylinux_2_24 tag leaves too many users without usable packages.
Using this tag requires to build libraries too or a libssh too old will
be used, with the segfault risks seen in the past.
OTOH building all the libraries on arm/ppc platforms proves very time
consuming and requires further tooling than what available in the image.
Because these packages are new it seems ok to use the manylinux_2_24
tag and use the package versions of libpq/libssl.
2021-06-15 18:42:25 +01:00
Daniele Varrazzo
37ab1d8877
Bump to a new dev version number to try to release new packages
2021-06-15 18:28:13 +01:00
Daniele Varrazzo
1d3a89a0bb
Copyright year updated to 2021
...
ag -l Copyright | xargs sed -i \
"s/\(.*copyright (C) [0-9]\+\)\(-[0-9]\+\)\?\(.*Psycopg Team.*\)/\1-$(date +%Y)\3/I"
2021-06-15 00:37:22 +01:00
Daniele Varrazzo
af05c3a1ec
Merge branch 'timezone-seconds'
2021-06-15 00:25:55 +01:00
Daniele Varrazzo
1d3d5e905f
Deprecate the psycopg2.tz module
...
Don't use its objects anymore in the tests (except for the tests for the
objects themselves).
2021-06-15 00:22:54 +01:00
Daniele Varrazzo
f28502663f
Use datetime.timezone as default tzinfo_factory.
2021-06-15 00:17:14 +01:00
Daniele Varrazzo
2eac70786e
Drop support for mx.DateTime objects
...
They are Python 2 only.
2021-06-14 23:05:48 +01:00
Daniele Varrazzo
476a969bd8
Handle correctly timestamps with fractions of minute in the timezone offset
...
Close #1272 .
2021-06-14 22:25:02 +01:00
Daniele Varrazzo
5667026883
Use a stdlib timezone in TimestampFromTicks
...
This is the only use of `LocalTimezone` in psycopg2 code.
2021-06-14 19:22:59 +01:00
Daniele Varrazzo
521981584d
Clean up the packaging procedure
2021-05-29 21:57:26 +01:00
Daniele Varrazzo
06c3c3a557
Merge branch 'packages'
2021-05-26 17:29:03 +01:00
Daniele Varrazzo
808007456d
Document the new way of building packages
2021-05-26 17:28:14 +01:00
Daniele Varrazzo
a9db3228d3
One line about the new packages in the news file
2021-05-26 17:28:14 +01:00
Daniele Varrazzo
52cd94442c
Add include and lib dirs from libpq --cppflags, --ldflags
...
They seem the right thing to fix MacOS build woes.
Inspired to #935 , might close #1200 .
2021-05-26 17:28:14 +01:00
Daniele Varrazzo
d116b80c5f
Add script to download packages from appveyor
2021-05-26 17:28:14 +01:00
Daniele Varrazzo
e7ce6761e1
Use Appveyor to build Windows packages
...
The script was executed both by this repos' appveyor config (to run the
tests) and by the psycopg2-wheels config (to build the packages). Now
there are two different workflows to execute for tests and to build packages.
The only way to swap them is to change the project config it seems, in
<https://ci.appveyor.com/project/psycopg/psycopg2/settings >.
2021-05-26 17:26:00 +01:00
Daniele Varrazzo
efae570a07
Build MacOS packages on GitHub Actions
2021-05-26 17:23:40 +01:00
Daniele Varrazzo
d1c7e6a094
Add script to download packages from GitHub
2021-05-26 17:23:40 +01:00
Daniele Varrazzo
9b91b09f9c
Enable qemu to build arm/ppc packages on github
2021-05-26 17:23:40 +01:00
Daniele Varrazzo
b5dd3aae86
Build packages for Python >= 3.6
2021-05-26 17:23:40 +01:00
Daniele Varrazzo
367ea40b1e
Allow libpq tests to fail
...
They fail on image build when we delete the system library.
2021-05-26 17:23:40 +01:00
Daniele Varrazzo
ec531bee31
Create sdist packages
...
Adapted from the psycopg2-wheels project
2021-05-25 23:23:27 +01:00
Daniele Varrazzo
8a2deb39ed
Escape table and column names in cursor.copy_from() and .copy_to()
2021-05-25 11:50:23 +01:00
Daniele Varrazzo
e5ad0ab2d9
'with' starts a transaction even on autocommit connections
...
Close #941
2021-05-24 14:13:19 +02:00
Daniele Varrazzo
d8e6426433
Fix formatting of last entries in the NEWS file
2021-05-24 14:11:06 +02:00
Daniele Varrazzo
506a10026a
Remove configuration for unused VS versions in appveyor build
2021-05-24 11:17:01 +02:00
Daniele Varrazzo
cb12317d21
Drop use of obsolete alias PyMem_Del
2021-05-24 11:15:24 +02:00
Daniele Varrazzo
e7c5f95bf6
Merge branch 'github-actions'
2021-05-22 17:21:06 +02:00
Daniele Varrazzo
09d6e3cf64
Use GitHub Actions badge in the readme
2021-05-22 17:20:54 +02:00
Daniele Varrazzo
5d19c6ef7e
Update GitHub Actions as on branch main_2_8
...
Drop Python version not supported on master.
Drop Travis workflow on master branch too.
2021-05-22 17:20:12 +02:00
Riccardo Magliocchetti
9dbe8c6757
ci: first stab at running CI as github actions
...
Props to Adam Chainz for sharing its setup.
2021-05-22 16:51:53 +02:00
Yusuke Hayashi
fed22d39e9
Fix typo
2021-05-22 14:30:11 +02:00
Daniele Varrazzo
19ddbc47ca
Merge branch 'rm-2.7'
2021-05-20 16:59:43 +02:00
Daniele Varrazzo
cdc83d64db
Add Python 3.9 to travis test grid, drop 2.7
2021-05-20 16:58:46 +02:00
Daniele Varrazzo
3db4abcfa4
Unbreak f-string wrong replacements
2021-05-20 16:49:05 +02:00
Daniele Varrazzo
8f40c648af
Merge branch 'master' into rm-2.7
2021-05-20 16:36:55 +02:00
Chris Wilson
45599b2716
Add warning about send_feedback and cursor choice
2021-05-20 16:33:00 +02:00
Hans Ginzel
787a7b90ae
cursor.rst typo: was creates
...
name attribute: “cursor was creates” → “was created”
2021-05-20 16:26:08 +02:00
Daniele Varrazzo
55aef83fa1
Merge branch 'sqlstate_errors'
2021-05-20 16:17:47 +02:00
Daniele Varrazzo
3487f627e2
Mention sqlstate reinit in NEWS file
2021-05-20 16:16:51 +02:00
Sandro Mani
f59d626fe3
Don't re-initialize psycoEncodings if already initialized
2021-05-20 16:14:24 +02:00
Sandro Mani
22575528be
Don't abort if sqlstate_errors already initialized
2021-05-20 16:14:24 +02:00
Daniele Varrazzo
0f457a01d9
Fix NEWS typo
2021-05-20 13:12:46 +02:00
Daniele Varrazzo
8ea5d0c0b8
Fix segfault initialising Column object manually
...
Close #1252
2021-05-20 13:10:59 +02:00
Daniele Varrazzo
391386cfb9
Accept no param in connect()
...
More friendly towards ``connect(**parse_dsn())``, and what psycopg3 does.
Close #1250
2021-05-20 13:10:53 +02:00
Tim Gates
0d7953a521
docs: fix a few simple typos
...
There are small typos in:
- doc/src/faq.rst
- psycopg/cursor_type.c
- psycopg/xid_type.c
- scripts/make_errorcodes.py
- scripts/make_errors.py
- tests/dbapi20.py
- tests/test_connection.py
Fixes:
- Should read `publicly` rather than `publically`.
- Should read `unicode` rather than `uniconde`.
- Should read `supposed` rather than `suppsed`.
- Should read `something` rather than `somenthing`.
- Should read `portable` rather than `portible`.
- Should read `exhausted` rather than `exausted`.
- Should read `compliance` rather than `compiliance`.
Closes #1275
2021-05-20 12:22:47 +02:00
Rafi Shamim
73969ba3e7
Skip test_encrypt_server for CockroachDB
2021-04-21 12:56:54 +01:00
arulajmani
f469331af5
Skip test_9_6_diagnostics test for CRDB
...
Previously, the CRDB's pg server version was 9.5, which meant this test
wasn't run as it is skipped for versions 9.6 and before. Now that the
server version of CRDB is 13, this check no longer applies.
This patch explicitly skips test_9_6_diagnostics for CRDB. The reason
for this is the same as test_9_3_diagnostics, which is currently
skipped for CRDB.
2020-12-16 23:41:45 +00:00
Hugo van Kemenade
8830e30f73
Merge branch 'master' into rm-2.7
2020-11-18 18:10:16 +02:00
Hugo van Kemenade
c3b65d63b6
Upgrade f-strings with flynt -a and remove int()
2020-11-18 18:09:08 +02:00
Daniele Varrazzo
e85ef2298b
Merge branch 'connection_exception'
2020-11-17 22:45:52 +00:00
Hugo van Kemenade
8d7f660309
Upgrade f-strings with flynt
2020-11-17 23:52:11 +02:00
Daniele Varrazzo
8449844af3
Merge branch 'pg13-win'
2020-11-17 21:07:52 +00:00
Hugo van Kemenade
d956eaa3b1
Drop support for EOL Python 2.7
2020-11-17 22:53:44 +02:00
Hugo van Kemenade
7babeccbec
Upgrade Python syntax with pyupgrade --py36-plus
2020-11-17 22:22:11 +02:00
Hugo van Kemenade
6c48b63ae4
Drop support for EOL Python 2.7
2020-11-17 22:22:11 +02:00
Sergey Golitsynskiy
b05a581931
Fix typo in sample code: psycopg >> psycopg2
2020-11-17 20:19:26 +00:00
Hugo van Kemenade
694a20fb95
Drop support for EOL Python 3.5 ( #1197 )
2020-11-17 20:17:12 +00:00
Daniele Varrazzo
490c53bace
Merge pull request #1000 from hugovk/rm-3.4
...
Drop support for EOL Python 3.4
2020-11-17 16:28:47 +00:00
Justas Sadzevicius
cdca0a20e0
Classify connection exceptions as operational errors to better conform with PEP 249
2020-11-17 18:02:06 +02:00
Hugo van Kemenade
60ed2770f3
Merge branch 'master' into rm-3.4
2020-11-17 18:01:04 +02:00
Daniele Varrazzo
8764a85320
Mention Python 3.9 supported
...
See #1183
2020-11-16 11:53:30 +00:00
Jason Erickson
f1dfbd59af
Build against PostgreSQL 13.0 and removed Py27/34
...
PostgreSQL 12 and 13 do not support older Microsoft Visual Studio compilers
and therefore we can not build against Python 2.7 and Python 3.4
2020-11-13 12:24:12 -07:00
Jason Erickson
e3f8cf0702
Remove old patch for Postgres 9.6 and OpenSSL 1.1
2020-11-13 12:22:38 -07:00
Hugo van Kemenade
d8aa60221d
Merge branch 'master' into rm-3.4
2020-11-13 21:22:26 +02:00
Jason Erickson
12b1432fe1
Build more OpenSSL binaries and add to path
...
More recent verions of the PostgreSQL source code requires some OpenSSL
binaries to be on the PATH.
2020-11-13 12:17:48 -07:00
Jason Erickson
f5e870dcc0
Combine included libraries into one parameter
...
build_ext only grabs one '-l' parameter, not multiple, which is weird as
one time I thought it did.
2020-11-13 12:05:20 -07:00
Daniele Varrazzo
87dc783bc6
Merge pull request #1190 from martinfrancois/master
...
Add support for PostgreSQL 13 (final)
2020-11-13 01:00:57 +00:00
martinfrancois
8c50af551d
update supported postgresql versions to include 13
2020-11-13 00:40:14 +01:00
martinfrancois
b125d9dd66
add postgresql 13 to the build matrix
2020-11-13 00:40:14 +01:00
Hugo
d04a420bce
Drop support for EOL Python 3.4
2020-11-10 08:44:42 +02:00
Daniele Varrazzo
f900fa4960
Bump to new major release development line on master
2020-11-09 23:17:56 +00:00
Daniele Varrazzo
7ad357599f
Merge branch 'py39-appveyor'
2020-11-04 21:22:45 +01:00
Jason Erickson
31b37685b7
Settings for Py39/VS2019 builds + OpenSSL update
2020-11-04 21:21:58 +01:00
Jason Erickson
163dadb6c6
Add Strawberry Perl to the path
2020-11-04 21:21:58 +01:00
Jason Erickson
ec39e1e406
Add VC 2019 path location
2020-11-04 21:21:58 +01:00
Daniele Varrazzo
7cd7b97d5d
First batch of changes to build on appveyor with Python 3.9
2020-11-04 21:20:27 +01:00
Jannis Vamvas
616dab7064
Remove semicolon from code example
2020-10-20 18:07:51 +02:00
Daniele Varrazzo
f54cf3b87b
Bump to next dev release
2020-09-06 17:24:33 +01:00
Daniele Varrazzo
dd97344149
Suggest how to auto-generate tag name in release doc
2020-09-06 17:24:04 +01:00
Daniel Fortunov
171371da5a
Minor spelling and grammar corrections for 195b254
2020-09-06 17:23:37 +01:00
Daniele Varrazzo
b203be11a6
Bump version to 2.8.6
2020-09-05 23:29:47 +01:00
Daniele Varrazzo
dc007e790a
Metion ARM packages in news file
2020-09-05 22:07:26 +01:00
Daniele Varrazzo
dec28a21ac
'cursor.query' reports the query of the last COPY opearation too
...
Close #1141 .
2020-09-05 21:47:35 +01:00
Daniele Varrazzo
dd1724c447
Errors mapping updated to PostgreSQL 13
2020-09-05 20:26:19 +01:00
Daniele Varrazzo
c203d681c4
Added duplicate values to errcodes module
...
Close #1133
2020-09-05 20:26:19 +01:00
Daniele Varrazzo
58c6a07e43
Errors fetch scripts ported to Python 3
2020-09-05 20:26:19 +01:00
Daniele Varrazzo
195b254937
Improve wording around transactions behaviour closing connections
...
The transaction is not rolled back by the connection, rather discarded
by the server.
Close #1135 .
2020-09-05 19:16:50 +01:00
Daniele Varrazzo
0ee9d840a1
Document context manager usage in connection and cursor docs
...
Close #1143
2020-09-05 18:51:33 +01:00
Daniele Varrazzo
9387bd3c09
Mention building wheels package with OpenSSL 1.1.1g in news file
2020-09-05 18:04:45 +01:00
odidev
6de8c0c6d2
Add ARM64 jobs in Travis-CI
...
Signed-off-by: odidev <odidev@puresoftware.com>
2020-08-25 06:37:53 +00:00
Daniele Varrazzo
f7618f8bf5
Merge pull request #1120 from bashtanov/dictcursor-docs-improvement
...
DictCursor docs improvement
2020-08-24 01:56:17 +01:00
Daniele Varrazzo
3aadecebaa
Merge pull request #1131 from jouve/py3.10compat
...
use Py_SET_TYPE for compat with python 3.10
2020-08-24 01:54:57 +01:00
Daniele Varrazzo
90e8c80ed1
Merge branch 'docs/quick-start'
2020-08-24 01:48:50 +01:00
Daniele Varrazzo
82d679cdb3
A few corrections to the install page
...
Spacing, lines length, a spurious link targed, reST formatting.
2020-08-24 01:48:31 +01:00
Daniele Varrazzo
b0ddf6ea90
Merge branch 'cockroachdb-tests'
2020-08-18 20:55:13 +01:00
Daniele Varrazzo
423a663306
Python 2 compatibility
2020-08-17 23:50:04 +01:00
Daniele Varrazzo
f339bb30fb
Added possibility to skip a test only on certain crdb versions
2020-08-17 23:08:05 +01:00
Daniele Varrazzo
5d2e51e76e
Added ticket numbers for the tests skipped on crdb
2020-08-17 22:31:48 +01:00
Daniele Varrazzo
6d8382b7ed
Added missing reasons for crdb skip
...
Added check to make sure a reason must be passed.
2020-08-17 21:27:25 +01:00
Edan Schwartz
9c30fdbc63
minor typo in docs
2020-08-10 09:18:45 -05:00
Edan Schwartz
ed3d44562d
Move pyscopg-binary install docs to "quick start" section
...
This is the fastest way for most folks to get up-and-running
with psycopg. We've seen a lot of noise in the GH issues with people
failng to install the non-binary version. Hopefully this will
make life easier for people new to psycopg/python.
See https://github.com/psycopg/psycopg2/issues/1085#issuecomment-659028139
2020-08-07 15:05:45 -05:00
Daniele Varrazzo
513b0019b1
TeamCity commit hook test
2020-08-04 22:29:24 +01:00
Daniele Varrazzo
6eb4fab1db
Added reason for skipping on CockroachDB
2020-07-27 23:03:26 +01:00
Cyril Jouve
442f300e91
use Py_SET_TYPE for compat with python 3.10
2020-07-26 15:41:53 +02:00
Daniele Varrazzo
5e957daa82
Types tests adapted to CockroachDB
2020-07-23 01:56:58 +01:00
Daniele Varrazzo
c8697e6c67
Several other tests skipped for CockroachDB
...
The only remaining test modules in this branch are test_types_basic/extra.
2020-07-22 02:43:19 +01:00
Daniele Varrazzo
a9153ac373
Some extra cursors test skipped on CockroachDB
...
Skip named cursor tests
2020-07-22 02:14:18 +01:00
Daniele Varrazzo
701637b5fa
Skip a few date tests on CockroachDB
...
- Infinity gets converted to large dates in the past/future out of
Python range
- Timestamps get an UTC timezone attached
2020-07-22 02:05:05 +01:00
Daniele Varrazzo
5ccd977e2b
Cursor tests adapted to CockroachDB
...
Named cursor tests separated to skip all in one go
2020-07-21 22:23:27 +01:00
Daniele Varrazzo
9380f2a721
Get CockroachDB version from the connection info
2020-07-21 22:22:58 +01:00
Daniele Varrazzo
7e1e801899
Skip copy tests on CockroachDB
2020-07-21 22:22:55 +01:00
Daniele Varrazzo
e154cbe5aa
Skip connection tests which cannot pass on CockroachDB
...
Features not supported seem:
- isolation level (always serializable)
- client encodings
- notices (maybe there is a way to generate them)
- 2 phase commit
- reset (because of the lack of transaction deferrable)
- backend pid
2020-07-21 22:22:23 +01:00
Daniele Varrazzo
bca72937d8
Expose libpq PG* vars as testconfig content
2020-07-21 22:21:44 +01:00
Daniele Varrazzo
f8c1cff6a3
Skip cancel tests on CockroachDB
...
One test moved to the async tests module, as it really belongs there.
2020-07-21 22:21:32 +01:00
Daniele Varrazzo
ee34198bf6
All the sync tests pass on CockroachDB
...
Added decorator to skip tests on crdb
2020-07-21 22:21:24 +01:00
Daniele Varrazzo
659910ee81
Allow most of the async tests to pass on CockroachDB
...
Added function to get crdb version from a connection
2020-07-21 01:43:57 +01:00
Daniele Varrazzo
cecff195fc
Merge pull request #1127 from rafiss/iso-level-finally-block
...
Handle failure in setup of IsolationLevelsTestCase
2020-07-08 20:35:01 +01:00
Rafi Shamim
a61f30b2d2
Handle failure in setup of IsolationLevelsTestCase
...
If the CREATE TABLE statement fails, the setup would fail
without committing or rolling back the active transaction, so the
transaction would hold onto its resources indefinitely.
Normally, the transaction would be closed when the connection is closed
in the `tearDown` function. However, `tearDown` is not called if there
was an error during `setUp` ([as specified by the `unittest` docs](https://docs.python.org/3/library/unittest.html#unittest.TestCase.tearDown )), so
we need to handle this case specially.
2020-07-07 18:48:44 -04:00
Alexey Bashtanov
96f0f63de2
dictcursor-docs-improvement
2020-06-18 15:40:45 +01:00
Daniele Varrazzo
779a1370ce
Merge pull request #1105 from rafiss/with-block-connection-test
...
Handle failure in setup of ConnectionTwoPhaseTest
2020-05-30 04:43:26 +12:00
Daniele Varrazzo
1092d437c0
Merge pull request #1111 from cjolif/master
...
use new URL for psycogreen
2020-05-29 01:37:06 +12:00
Christophe Jolif
1afbaf495e
use new URL for psycogreen
2020-05-28 14:11:34 +02:00
Daniele Varrazzo
a9b814cb53
Merge pull request #1110 from UpGado/patch-1
...
Fix ctypes doc example AttributeError
2020-05-27 22:25:15 +12:00
Dio Gado
ac488acee3
Fix ctypes example AttributeError
2020-05-27 05:39:53 -04:00
Rafi Shamim
f935476b3f
Handle failure in setup of ConnectionTwoPhaseTest
...
Previously, this test had a bug, because if the CREATE TABLE statement
failed, the setup would fail without committing or rolling back the
active transaction.
2020-05-12 12:48:35 -04:00
Daniele Varrazzo
14355e9c69
Merge pull request #1103 from franciscouzo/patch-1
...
Fix typo
2020-05-07 19:39:48 +12:00
Francisco Couzo
7fdf77065d
Fix typo
2020-05-07 04:11:50 -03:00
Daniele Varrazzo
690772f093
Merge branch 'mx-search'
2020-05-06 16:02:00 +12:00
Daniele Varrazzo
a75afe4d83
Mention fixing mx search in news file
...
Close #996 .
2020-05-06 14:46:58 +12:00
Colin 't Hart
f9442744af
Fixed search of mxDateTime headers
...
- Find mxDateTime.h automatically on path directories.
- Prefer mxDateTime.h found in venv over one found in /usr/include.
2020-05-06 14:42:10 +12:00
Daniele Varrazzo
1ec0bb5633
Mention python3-dev as possibly required dev package name
...
Close #1092 .
2020-05-05 00:23:57 +12:00
Daniele Varrazzo
87279d5d03
Mention CALL on stored procedures using transaction in autocommit
...
Close #1072 - I prefer to mention them where there is a discussion of
the feature rather than in the method or const values section.
2020-05-05 00:19:38 +12:00
Daniele Varrazzo
accd1965bb
Merge remote-tracking branch 'pombredanne/patch-1'
2020-05-04 23:55:29 +12:00
Daniele Varrazzo
d0216ce68d
Merge branch 'client-encoding-leak'
2020-05-04 23:53:08 +12:00
Daniele Varrazzo
a35549d0ad
Mention ticket #1101 closed in news file
2020-05-04 23:52:58 +12:00
Daniele Varrazzo
6043dac0ea
Bump to next dev release
2020-05-04 23:50:05 +12:00
Kevin Michel
364b0e0563
Fix memory leak in conn_set_client_encoding
...
If the specified encoding is the same as the current one,
the early exit did not release the clean_enc string allocated
by clear_encoding_name.
2020-05-04 09:40:36 +02:00
Philippe Ombredanne
4c3e0e5f1d
Improve doc wording
...
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
2020-04-28 22:37:59 +02:00
Philippe Ombredanne
75c659a5e7
Fix typo and improve grammar in doc
...
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
2020-04-28 22:27:29 +02:00
Federico Di Gregorio
8b2450287e
Removed ZPL license ( closes : #1087 )
2020-04-28 18:53:14 +02:00
Daniele Varrazzo
cb3353be1f
Releasing psycopg 2.8.5
2020-04-06 17:00:57 +12:00
Daniele Varrazzo
f2852a520a
Merge branch 'add-aix-support'
2020-04-06 16:49:42 +12:00
Daniele Varrazzo
012a20b010
Mention AIX support in NEWS file
2020-04-06 16:46:44 +12:00
Jon Dufresne
fbba461052
Fix typo: occured → occurred
2020-04-06 16:40:45 +12:00
Daniele Varrazzo
62743c3be1
Fixed copy() on DictRow
...
Close #1073 .
2020-04-06 14:10:02 +12:00
Abdirahim Musse
6de23eb793
fixup! feat: Add AIX support
2020-03-12 13:21:02 -05:00
Daniele Varrazzo
2bee47efac
Merge branch 'column-slice'
2020-03-13 00:17:57 +13:00
Daniele Varrazzo
054123254e
Column objects can be sliced
...
Close #1034 .
2020-03-11 10:50:56 +13:00
Daniele Varrazzo
5d96b0c024
Merge branch 'cffi-in-docs'
2020-03-08 11:34:20 +00:00
Daniele Varrazzo
34615b7629
Better descriptions of the non-C porting in install docs
2020-03-08 11:33:31 +00:00
Daniele Varrazzo
34c54f3fc3
Merge branch 'logging-adapter'
2020-03-08 11:23:32 +00:00
Daniele Varrazzo
497ad5c7c0
Mention LoggingAdapter in news
2020-03-08 11:22:43 +00:00
Abdirahim Musse
de58332bdd
feat: Add AIX support
2020-03-05 12:34:25 -06:00
Daniele Varrazzo
12bc9d68c4
Added funding file
2020-02-22 18:54:05 +00:00
Daniele Varrazzo
9bcca1a7b0
Dropped customized doc template
...
It was meant to be used only by the website, not for the doc shipped
with the package.
[skip ci]
2020-01-27 04:32:31 +00:00
Daniele Varrazzo
f2d13ec809
Upload on https now
2020-01-27 02:58:58 +00:00
Daniele Varrazzo
e14e3385b4
Merge branch 'goodbye-initd'
2020-01-25 19:54:30 +00:00
Daniele Varrazzo
1c80c9d8d5
Trigger docs rebuild on push
2020-01-25 19:51:21 +00:00
Daniele Varrazzo
e9dc1df889
Added sql module basic usage section and classes hierarchy
2020-01-20 21:00:58 +00:00
Daniele Varrazzo
dbd6577d91
Fixed dependencies in docs build
...
Building without having built the library failed
2020-01-19 00:43:42 +00:00
Daniele Varrazzo
94a660aa6f
Use a responsive theme for docs
...
With a pleasant ottanio background.
2020-01-18 23:56:44 +00:00
Daniele Varrazzo
584197f57d
Hide the "made with sphinx" doc footer
2020-01-18 19:37:13 +00:00
Daniele Varrazzo
5e0b02afb2
Copyright bumped to 2020
2020-01-17 21:21:11 +00:00
Bjoern Boschman
93aa469f16
#1026 added support for logging.LoggerAdapter
2020-01-07 13:46:21 +00:00
Daniele Varrazzo
8a6b280d86
Use an ssh config file to configure package uploading
...
[skip ci]
2020-01-04 16:59:52 +01:00
Daniele Varrazzo
9bfde497e5
Copyright 2020 in the docs
2020-01-04 01:39:29 +01:00
Daniele Varrazzo
c3c24cd67b
Website on https
2019-12-31 13:09:13 +01:00
Daniele Varrazzo
501b0412f6
CI resources moved to upload.psycopg.org
2019-12-31 09:59:32 +01:00
Daniele Varrazzo
9154d0920c
Changed docs to point to psycopg.org
2019-12-30 18:12:46 +01:00
Daniele Varrazzo
3d29ace058
Document a release procedure not using initd server
2019-12-30 17:13:37 +01:00
Daniele Varrazzo
46022cb162
Merge branch 'py38-win'
2019-12-30 17:11:21 +01:00
Daniele Varrazzo
f4144615f7
Blacklist docutils 0.15 to build docs
...
It crashes because of https://sourceforge.net/p/docutils/bugs/353/
2019-12-29 23:54:18 +01:00
Daniele Varrazzo
c3b35ba510
Merge branch 'fix-1019'
2019-12-10 11:09:27 +00:00
Daniele Varrazzo
c20c13c493
Fixed use of cursor_factory attribute in connecion subclasses
...
Close #1019
2019-12-09 11:11:39 +00:00
Daniele Varrazzo
5c02fdaa0d
Bump to next dev version
2019-12-09 11:10:58 +00:00
Daniele Varrazzo
9c32457c28
Added Python 3.8 build on Appveyor
2019-11-10 20:58:44 +00:00
Omer Katz
a1fd2da1dc
Mention the CFFI port to Psycopg2 in documentation.
...
The CFFI port works much better on PyPy and has been used in production before.
The documentation mentioned the Ctypes port but not the CFFI port.
I added it to the documentation.
2019-10-23 12:05:33 +03:00
Daniele Varrazzo
d70d3ee482
Bump to version 2.8.4
2019-10-20 01:25:21 +01:00
Daniele Varrazzo
16c07ba9c4
Mention the library versions packaged in the 2.8.4 wheel in the NEWS file
2019-10-20 01:19:47 +01:00
Daniele Varrazzo
cb7109dfa9
Merge branch 'fix-951'
2019-10-19 18:38:56 +01:00
Daniele Varrazzo
eb893e65f0
Mention fixing time.h include in NEWS
...
Mostly to remember why we did it.
2019-10-19 18:11:10 +01:00
Daniele Varrazzo
b0b09cbb24
Merge branch 'bugfix/940'
2019-10-19 18:04:02 +01:00
Daniele Varrazzo
63352d7da0
Mention bug 940 fixed in NEWS file
2019-10-19 18:02:32 +01:00
Jann Kleen
4097b4f2a0
Fix typo 'againts'
2019-10-19 17:58:37 +01:00
Daniele Varrazzo
8a18ff7699
Mention that with PgBouncer get_backend_pid() is not updated
...
Close #956
2019-10-19 17:57:31 +01:00
Daniele Varrazzo
850c585501
Added UltraJSON example
...
Close #972
2019-10-19 17:47:01 +01:00
Daniele Varrazzo
2f094841b2
Slow test is slow
2019-10-19 16:29:16 +01:00
Daniele Varrazzo
96156727c0
Allow parsing boolean both upper and lowercase
...
Reportedly useful on H2 databases.
Close #965
2019-10-19 16:28:10 +01:00
Daniele Varrazzo
5e9572aff8
Revert testing on Windows to libpq 11.4
...
Build broken by:
d993e0fb82
Error at:
https://ci.appveyor.com/project/psycopg/psycopg2/builds/28228647/job/490uo4qko6cguldl
2019-10-19 16:17:01 +01:00
Daniele Varrazzo
24a8d600bf
Test on appveyior with libpq 11.5 and openssl 1.1.1d
...
Will mention the new libraries' support after testing with wheels
2019-10-19 16:10:15 +02:00
Daniele Varrazzo
b2a09fb404
Merge branch 'pg12'
2019-10-19 16:09:41 +02:00
Daniele Varrazzo
b029bd80d4
Merge branch 'py38'
2019-10-19 16:08:06 +02:00
Daniele Varrazzo
500f438033
Support for Python 3.8 mentioned in news file
2019-10-19 16:07:35 +02:00
Daniele Varrazzo
ade98c1359
Added Py 3.8 support to appveyor build
...
VS 14 is the one to use: https://wiki.python.org/moin/WindowsCompilers
Note that appveyor doesn't have Py 3.8 yet though.
2019-10-19 16:01:13 +02:00
Daniele Varrazzo
38a411dc07
Test Python 3.4 on xenial
...
Trusty is no more required, and PG 12 is not available there.
2019-10-19 15:50:57 +02:00
Daniele Varrazzo
214a8efe64
Test PG 11 and 12 on travis
2019-10-19 15:26:20 +02:00
Daniele Varrazzo
d5c7ec7ae8
Added Postgres 12 errors
2019-10-19 15:22:48 +02:00
Daniele Varrazzo
8f11821c17
Use travis test config variable 0/1 instead of blank strings
...
Travis web interface doesn't allow anymore to set an empty string as
variable value.
2019-10-19 15:18:38 +02:00
Daniele Varrazzo
58654990d6
Install postgres from pgdg on travis if available there
2019-10-19 14:38:49 +02:00
Daniele Varrazzo
0dec435856
Dropped download url from package metadata
...
Not really useful anymore as PyPI is the official download place.
2019-10-19 14:09:44 +02:00
Jon Dufresne
4e13acdc88
Add Python 3.8 to the test matrix
...
Python 3.8 was released on October 14th, 2019.
- Added 'Programming Language :: Python :: 3.8' trove classifier.
- Added 'py38' to the tox test matrix.
- Added 'python: 3.8' to the Travis test matrix.
- Removed 'dist: xenial' from Travis configuration; it is now the
default.
- Removed 'dist: trusty' from Travis configuration; it is not longer
necessary.
- Removed 'sudo' from Travis configuration; it is deprecated.
https://docs.python.org/3.8/whatsnew/3.8.html
2019-10-18 18:29:59 -07:00
Daniele Varrazzo
f08019e356
Added decorator to clean up the adaptation mappings after tests
...
Many tests were doing it manually, some weren't doing it and resulted in
failure if run in different order.
Close #948
2019-09-04 18:17:51 +01:00
Daniele Varrazzo
33d3c074fa
Merge branch 'fix-961'
2019-09-04 13:22:16 +01:00
Daniele Varrazzo
80df0553a6
Fixed handling large Oid values
...
Oid is defined as unsigned 32. On some Python implementations (probably
the ones where maxint = 2 ** 31) this can cause int overflow for large
values (see #961 ). On my 64 box it doesn't seem the case.
Oid handling was sloppy here and there (messages, casts...): trying to
use uint everywhere, and added a couple of helper macros to treat Oid
consistently.
Close #961 .
2019-09-04 12:30:18 +01:00
Samuel Marks
a47fcdd508
[psycopg/pqpath.c] sys/time.h include for non mac & Windows
...
Signed-off-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
2019-08-05 15:07:43 +10:00
Alexander Kukushkin
9097a5b989
Don't advance replication cursor when the message wasn't confirmed
...
Fixes https://github.com/psycopg/psycopg2/issues/940
2019-07-05 08:37:24 +02:00
Daniele Varrazzo
4d10f1235f
Merge branch 'obscure-password-before-connect'
2019-06-24 12:14:29 +01:00
Daniele Varrazzo
6e972200a3
Mention ctrl-c swallowing fixed in news file
2019-06-24 12:13:47 +01:00
Daniele Varrazzo
3465ce282e
Function to obscure password moved to connection_int
2019-06-24 12:11:12 +01:00
Daniele Varrazzo
f40ad0f3ae
Obscure the dsn password before storing it into the connection
...
This avoids the need to juggle with exceptions in order to scrub the
password after a connection error, which may also swallow signals
(see #898 ).
2019-06-22 19:22:27 +01:00
Jon Dufresne
491296e0f5
Fix typo: "the the"
2019-06-21 11:26:47 +01:00
Daniele Varrazzo
ee056bc6e8
Bump to next dev version number
2019-06-21 11:26:29 +01:00
Kunal Marwaha
c32dbf357c
typo: remove 'a'
2019-06-19 00:32:54 +01:00
Daniele Varrazzo
bc65c636ae
Bump to version 2.8.3
2019-06-10 23:21:50 +01:00
Daniele Varrazzo
91a8962770
Added entry about how to ask questions
...
Also fixed mailing list link (although it doesn't seem there's a link to
a subscription page anymore, you have to go through the community
portal).
Close #930 .
2019-06-10 23:18:11 +01:00
Daniele Varrazzo
be8e1a2632
Making my linter happy
2019-06-07 18:20:36 +01:00
Daniele Varrazzo
2635f43788
Merge branch 'fix-namedtuple-cache'
2019-06-07 18:19:47 +01:00
Daniele Varrazzo
0578c1ab92
Mention #928 fixed
2019-06-07 18:18:48 +01:00
Changaco
842e383c0c
fix NamedTupleCursor._cached_make_nt
2019-06-04 14:30:30 +02:00
Changaco
527592a0a5
improve the NamedTupleCursor cache test
2019-06-04 13:45:37 +02:00
Daniele Varrazzo
668d507c34
Merge branch 'feature/smart-feedback'
2019-05-12 23:55:11 +09:00
Daniele Varrazzo
b79895186c
Added news entry about smart replication feedback
2019-05-12 23:48:51 +09:00
Alexander Kukushkin
90755e6f13
Address code-review
2019-05-07 14:18:09 +02:00
Alexander Kukushkin
5eec11f232
Improve docs
2019-05-06 15:42:37 +02:00
Alexander Kukushkin
f827e49f55
Change the default value of keepalive_interval parameter to None
...
The previous default value was 10 seconds, what might cause silent
overwrite of the *status_interval* specified in the `start_replication()`
2019-05-06 15:26:21 +02:00
Alexander Kukushkin
6cff5a3e08
Smart replication feedback
...
This commit makes psycopg2 responsible for sending the status update
(feedback) messages to the server regardless of whether a synchronous or
asynchronous connection is used.
Feedback is sent every *status_update* (default value is 10) seconds,
which could be configured by passing a corresponding parameter to the
`start_replication()` or `start_replication_expert()` methods.
The actual feedback message is sent by the
`pq_read_replication_message()` when the *status_update* timeout is
reached.
The default behavior of the `send_feedback()` method is changed.
It doesn't send a feedback message on every call anymore but just
updates internal structures. There is still a way to *force* sending
a message if *force* or *reply* parameters are set.
The new approach has certain advantages:
1. The client can simply call the `send_feedback()` for every
processed message and the library will take care of not overwhelming
the server. Actually, in the synchronous mode it is even mandatory
to confirm every processed message.
2. The library tracks internally the pointer of the last received
message which is not keepalive. If the client confirmed the last
message and after that server sends only keepalives with increasing
*wal_end*, the library can safely move forward *flush* position to
the *wal_end* and later automatically report it to the server.
Reporting of the *wal_end* received from keepalive messages is very
important. Not doing so casing:
1. Excessive disk usage, because the replication slot prevents from
WAL being cleaned up.
2. The smart and fast shutdown of the server could last indefinitely
because walsender waits until the client report *flush* position
equal to the *wal_end*.
This implementation is only extending the existing API and therefore
should not break any of the existing code.
2019-05-06 10:27:44 +02:00
Daniele Varrazzo
f96982bdfd
Merge remote-tracking branch 'origin/appveyor-py'
2019-05-01 16:30:09 +01:00
Daniele Varrazzo
ed7d8ea28c
Appveyor: added package_name to options
2019-04-22 22:39:59 +01:00
Daniele Varrazzo
014097c1af
Dropped command line config from appveyor scrips
...
Only use env vars, they were unused.
Use consistently a config object with properties instead of functions
(the one returning a binary are especially dangerous if parens are
forgotten).
Also add helpers to call the target python more succinctly.
2019-04-22 12:41:44 +01:00
Daniele Varrazzo
1b2c1d620f
Run tests more quiet/faster building wheels
...
We are mostly interested it installed alright.
2019-04-22 11:24:29 +01:00
Daniele Varrazzo
285c64d101
Better dir names in appveyor build
2019-04-22 11:24:29 +01:00
Daniele Varrazzo
637a990e09
Added support for wheel building and uploading
...
To be used by the psycopg/psycopg2-wheels project.
2019-04-22 11:24:29 +01:00
Daniele Varrazzo
9eec303cf7
Configure postgres to run appveyor tests on ssl
2019-04-22 11:24:29 +01:00
Daniele Varrazzo
b1078b1b92
Setup build environment only before building
2019-04-22 11:24:29 +01:00
Daniele Varrazzo
1178501aaf
appveyor: added logging level configuration
2019-04-22 11:24:29 +01:00
Daniele Varrazzo
5c72203180
Using pathlib to manipulate paths
2019-04-22 11:24:29 +01:00
Daniele Varrazzo
591476621c
Dropped problematic init step
...
It was performed before repos cloned so no resource available (including
the script!)
2019-04-22 11:24:29 +01:00
Daniele Varrazzo
fda738c90d
All together now, let's make this real
2019-04-22 02:54:56 +01:00
Daniele Varrazzo
5858b0b9b4
Test packages from Python
2019-04-22 02:54:56 +01:00
Daniele Varrazzo
169ce22228
Build psycopg from Python
2019-04-22 02:54:56 +01:00
Daniele Varrazzo
c875197432
Build libpq from Python
2019-04-22 02:54:56 +01:00
Daniele Varrazzo
73f6a0cd95
Build openssl from Python
2019-04-22 02:54:56 +01:00
Daniele Varrazzo
37ce131d2c
Added setenv to log env vars changes
2019-04-22 02:54:56 +01:00
Daniele Varrazzo
00fc2820a0
Added script to implement appveyor functionality in Python
...
Only the init step for the moment.
2019-04-22 02:54:56 +01:00
Daniele Varrazzo
325aadbf2c
Check return code of pthread_mutex_init
...
Close #901
2019-04-21 11:53:34 +01:00
Daniele Varrazzo
39b1994c26
Bump to next dev version number
2019-04-21 11:53:13 +01:00
Daniele Varrazzo
324cded166
Bumping to version 2.8.2
2019-04-14 15:11:31 +01:00
Daniele Varrazzo
6b740df704
Added FAQ entry about the change in binary packages in 2.8
2019-04-14 15:08:07 +01:00
Daniele Varrazzo
4821a6294e
Merge branch 'openssl-1.1-windows'
2019-04-14 14:49:41 +01:00
Daniele Varrazzo
26b61e809f
Mention building openssl 1.1 on windows in news file
...
Close #836 .
2019-04-11 01:42:54 +01:00
Daniele Varrazzo
14bfc54344
Mention fix to repeated fields in RealDictCursor in news file
2019-04-11 00:54:55 +01:00
Daniele Varrazzo
72fe91c02e
Build and test with openssl 1.1 on windows
...
Porting to openssl 1.1 by Matthew Brett, from the psycopg2-wheel repos.
2019-04-11 00:27:49 +01:00
Daniele Varrazzo
5e01c47818
Highlight in docs that the context manager doesn't close the connection
...
Code as in #889 is not robust, but the behaviour is actually
counter-intuitive.
2019-04-07 11:19:56 +01:00
Daniele Varrazzo
4058f363d6
More robust RealDictRow population
...
In the presence of repeated columns the mapping would have remained into
into the dictionary. Now it is removed.
Fix #884
2019-04-06 21:17:28 +01:00
Daniele Varrazzo
63e4bc961e
Version bumped to next dev release
2019-04-06 21:16:42 +01:00
Daniele Varrazzo
3357477fde
Fixed debug title level in news
2019-04-06 20:49:00 +01:00
Daniele Varrazzo
d2dce4dd17
Fixed link to RealDictRow from last news
2019-04-06 20:22:03 +01:00
Daniele Varrazzo
15d684134f
Bumping to version 2.8.1
2019-04-06 20:12:10 +01:00
Daniele Varrazzo
5c4b8a3d1f
Merge branch 'fix-886'
2019-04-06 20:09:47 +01:00
Daniele Varrazzo
cc815e8e8d
RealDictRow inherits from OrderedDict
...
Now its state is unmodified, so apart from special-casing creation
and initial population can work unmodified, and all the desired
properties just work (modifiability, picklability...)
Close #886 .
2019-04-06 19:43:31 +01:00
Daniele Varrazzo
21d16b6f67
Fixed RealDictCursor.pop()
...
Addresses #886 , but there might be something else broken there.
2019-04-06 19:43:09 +01:00
Daniele Varrazzo
7b31b39fed
Merge branch 'fix-887'
2019-04-06 10:51:03 +01:00
Daniele Varrazzo
46106e1b78
Test notifies are received ok polling an async cur
2019-04-05 19:04:48 +01:00
Daniele Varrazzo
755a128ffb
Handle ok poll() without a cursor having executed queries
...
Close #887
2019-04-05 18:04:55 +01:00
Daniele Varrazzo
34d45aea87
Bump to next dev release
2019-04-05 18:02:30 +01:00
Daniele Varrazzo
c64d2448e8
Bumping to 2.8 for release
2019-04-03 10:44:07 +01:00
Daniele Varrazzo
544e157649
Fixed replication cursor docs warning indentation level
2019-04-01 10:54:01 +01:00
Daniele Varrazzo
ed74189acd
Replication objects docs header level bumped up
...
Now it appears in the ToCs.
2019-04-01 10:40:44 +01:00
Daniele Varrazzo
813ca30953
Fixed notice about new wal_end attribute being on the cursor
2019-04-01 10:40:06 +01:00
Daniele Varrazzo
b76ff2fc33
Merge branch 'keepalive-save-wal-end'
...
Close #800
2019-03-30 21:29:39 +00:00
Daniele Varrazzo
b8bf6d9917
Added news entry about ReplicationMessage.wal_end
2019-03-30 21:23:20 +00:00
grunskis-bonial
ff91ad5186
Address code review feedback
2019-03-30 21:23:13 +00:00
Martins Grunskis
f946042a79
Store WAL end pointer in the replication cursor
2019-03-30 21:23:11 +00:00
Andrew Rabert
3eecf34bea
Add time type conversion info to docs
2019-03-24 23:09:36 +00:00
Daniele Varrazzo
953bc66ca6
Allow tests to be ignored if dynamic binding failed
2019-03-18 19:49:16 +00:00
Daniele Varrazzo
5b4caadd23
Version number changed to release version 2.8 beta 2 packages
2019-03-18 14:59:04 +00:00
Daniele Varrazzo
8b7506f80d
Merge branch 'naming'
2019-03-18 01:54:44 +00:00
Daniele Varrazzo
e569e49b8b
Merge branch 'fix-829'
2019-03-18 01:53:59 +00:00
Daniele Varrazzo
f8f5a77838
Mention closed #829 in NEWS file
2019-03-18 01:51:29 +00:00
Daniele Varrazzo
0c581380c7
Allow incorrect result for pgconn_ptr test on OSX
...
I don't know why it returns 0 instead of the right value. At least it
doesn't segfault, so don't skip the test altogether.
The test is unrelated to this branch: will cherry-pick elsewhere (if I
remember it...)
2019-03-18 01:41:56 +00:00
Daniele Varrazzo
7571ec9368
Run tests on windows using the same library versions of the packages
2019-03-18 01:41:56 +00:00
Daniele Varrazzo
eedbb33226
Appveyor tests in order of sort what I care
2019-03-18 00:33:31 +00:00
Daniele Varrazzo
17b0c61338
Don't close connections from forked processes
...
On Py3 subprocessing will actually GC the objects and the FD is open,
resulting in connections closed in different processes.
The behaviour is verified in py 3.4 to 3.7 at least,
2019-03-18 00:32:40 +00:00
Daniele Varrazzo
62a078fe0c
subprocess test function moved into a module
...
It won't work on windows if it's in the script: failing with errors
such as:
AttributeError: 'module' object has no attribute 'process'
or:
Can't get attribute 'process' on <module '__main__' (built-in)>
2019-03-17 23:55:04 +00:00
Daniele Varrazzo
7c5afd6977
Added test to reproduce ticket #829
...
Unrelated processes close the FD of the connection. This happens in
Python 3.6 but not 2.7. Let's see if travis shows where else it fails...
2019-03-17 23:06:55 +00:00
Daniele Varrazzo
458254c49e
Windows doesn't like the name "connect" for a function
2019-03-17 22:26:02 +00:00
Daniele Varrazzo
dc5dd30526
Prefix 'psycopg_' changed to 'psyco_'
2019-03-17 18:45:25 +00:00
Daniele Varrazzo
e4d365705a
Several function names shortened
...
There's not so much need for a strict convention for static functions.
Leaving some 'psyco_' prefix when the internal function and the
python-exposed function clashed.
2019-03-17 18:33:15 +00:00
Daniele Varrazzo
b4b470c29a
Allow 0 as key in the pool
...
Close #848
2019-03-17 18:24:50 +00:00
Daniele Varrazzo
155c739863
Merge branch 'use-conn-pgres'
2019-03-17 04:43:58 +00:00
Daniele Varrazzo
a5c0a2215e
Dropped whole "critical" story
...
It doesn't seem "critical" errors are used anymore. pq_set_critical()
wasn't called anywhere.
2019-03-17 03:49:34 +00:00
Daniele Varrazzo
17a074b30a
Use the error on the connection instead of passing it explicitly around
2019-03-17 03:49:34 +00:00
Daniele Varrazzo
97220eadc6
Added helper methods to set a result into a connection/cursor
2019-03-17 03:49:34 +00:00
Daniele Varrazzo
e740c21ee6
Dropped pgconn argument from conn_setup()
2019-03-17 03:49:34 +00:00
Daniele Varrazzo
c15e4c1a85
Use the connection's PGresult to pass results through calls
2019-03-17 03:49:34 +00:00
Daniele Varrazzo
5957a7ee45
Fixed handling of internal query too large
2019-03-17 03:49:34 +00:00
Daniele Varrazzo
917335eacb
Merge branch 'fix-856'
2019-03-17 03:48:40 +00:00
Daniele Varrazzo
963123812d
Make sure to free the connection's pgres on delete
2019-03-17 02:25:45 +00:00
Daniele Varrazzo
734845b79a
Added pq_get_result_async() replaced pg_get_last_result()
...
The new function keeps together PQconsumeInput() with PQisBusy(), in
order to handle the condition in which not all the results of a sequence
of statements arrive in the same roundtrip.
Added pointer to a PGresult to the connection to keep the state across
async communication: it can probably be used to simplify other code
paths where a result is brought forward manually.
Close #802
Close #855
Close #856
2019-03-17 01:20:06 +00:00
Daniele Varrazzo
761c3784c4
Retrieving the async cursor moved out of conn_poll() body
2019-03-16 20:05:40 +00:00
Daniele Varrazzo
e864050d07
Simplified interactions between asyc functions
...
Have advance_write calling flush itself, advance_read calling is_busy
itself, rather than calling them in the caller and passing the result.
Why we were doing the former on write I don't know. On read the paths
between async and green function was different but they got unified in
the previous commit.
2019-03-16 20:05:40 +00:00
Daniele Varrazzo
2a8fa4bef7
Dropped locking version of pq_is_busy()
...
The locking version was used for sync connections, the non-locking one
for green ones. However it only calls non-blocking functions, so it
doesn't really matter releasing the gil. So have only the non-locking
one.
Note that the name are sort of swapped: pq_is_busy() does now what
pq_is_busy_locked() used to do.
2019-03-16 20:05:40 +00:00
Daniele Varrazzo
5467f65122
Dropped no_begin handling in async execute
...
no_begin is only used with withhold named cursors, and it's not possible
to create named cursors on async connections.
2019-03-16 20:05:40 +00:00
Daniele Varrazzo
0935c9d8ca
Dropped debug info for microprotocols/adapters initialization
...
Not useful anymore (guess they were when those layers were created).
Much shorter stream of messages on module init now.
2019-03-16 20:05:40 +00:00
Daniele Varrazzo
d61c902230
Shorter timeout in the async tests select
2019-03-16 20:05:40 +00:00
Daniele Varrazzo
b5c7c93092
Merge branch 'version-check-cleanup'
2019-03-16 19:55:17 +00:00
Daniele Varrazzo
e922e2a96e
Py2/3 compatibility macro definitions rationalized
2019-03-16 19:54:40 +00:00
Daniele Varrazzo
fec0a5587d
Fixed check for type == int on Py2
2019-03-16 19:54:40 +00:00
Daniele Varrazzo
b9d0808f95
Added PY_2, PY_3 macros and used uniformly
2019-03-16 19:54:40 +00:00
Daniele Varrazzo
8448b3b840
Dropped conditional compiling dealing with unsupported versions
...
Also dropped shameful use of PY_MINOR_VERSION.
2019-03-16 19:54:40 +00:00
Daniele Varrazzo
dfb301b42b
Use PY2, PY3 for conditional code instead of sys.version_info
2019-03-16 19:54:40 +00:00
Daniele Varrazzo
f4a2630f1a
Added PY2, PY3 to compat module
2019-03-16 19:54:40 +00:00
Daniele Varrazzo
4ace9544ff
Merge branch 'fix-imports'
2019-03-16 19:53:45 +00:00
Daniele Varrazzo
e8135ee2cf
Use errors module to catch a specific postgres error
2019-03-16 19:13:58 +00:00
Daniele Varrazzo
b0119fef81
Other import moved to top level in tests
2019-03-16 19:13:58 +00:00
Daniele Varrazzo
8cfe176a85
Dropped repeated conditional import of reload in test
2019-03-16 19:04:40 +00:00
Daniele Varrazzo
aaba4dcf87
TextIOBase moved to tests compat imports
2019-03-16 18:41:59 +00:00
Jon Dufresne
d90ad8627d
Move imports to the top of the module across tests
...
Allows removing many duplicate imports and better follows PEP8
guidelines:
https://www.python.org/dev/peps/pep-0008/#imports
> Imports are always put at the top of the file, just after any module
> comments and docstrings, and before module globals and constants.
2019-03-16 18:03:41 +00:00
Jon Dufresne
194efc4375
Fix invalid exception handler: except e:
...
Fixes flake8 warning:
./tests/test_connection.py:390:16: F821 undefined name 'e'
./tests/test_connection.py:391:61: F821 undefined name 'e'
./tests/test_connection.py:408:16: F821 undefined name 'e'
./tests/test_connection.py:409:61: F821 undefined name 'e'
In the event of an unexpected error, let the exception bubble up the
stack for a more informative test failure message.
2019-03-16 17:59:18 +00:00
Jon Dufresne
432fdd7d32
Removed support for mxDateTime as the default date and time adapter
...
The use_pydatetime configuration option has been removed. Now, always
default to Python's builtin datetime. mxDatetime support continues to be
available as an alternative to Python's builtin datetime.
2019-03-16 16:36:49 +00:00
Jon Dufresne
8685120485
Remove unnecessary except ImportError
for Python datetime types
...
The Python datetime module is available on all supported platforms. The
types are always available and never raise an ImportError.
2019-03-16 16:35:51 +00:00
Jon Dufresne
ad4c6a4673
Use unittest 'skip' feature to skip mxDateTimeTests
...
Rather than deleting, the class, use the skip feature. Provides a more
informative message during test output.
Never skip DatetimeTests as all supported Python environments have the
datetime module builtin.
2019-03-13 15:01:34 +00:00
Jon Dufresne
d411dc3a73
Remove unused use_pydatetime from setup.py
...
Looks to have been mistakenly reintroduced in
b537404487
.
2019-03-13 15:00:25 +00:00
Jon Dufresne
6db347b5d7
Remove unused use_pg_dll from setup.py
...
Unused since 3076046b3f
.
2019-03-13 11:20:27 +00:00
Jon Dufresne
3f890f8bbe
Use True/False instead of 1/0 to represent bool values
...
Slightly more modern, readable, and Pythonic.
2019-03-13 11:13:36 +00:00
Jon Dufresne
afbbdd18b6
Remove unused variable
...
The variable i is immediately overwritten by the next line.
2019-03-13 11:13:24 +00:00
Jon Dufresne
03bb44dd2c
Convert while 1:
statements to while True:
...
A slightly more readable and modern syntax.
2019-03-13 11:13:05 +00:00
Jon Dufresne
18f5d5ad05
Remove unused imports from tests/test_ipaddress.py
2019-03-13 11:12:48 +00:00
Daniele Varrazzo
f2654d3573
Advertise openssl 1.0.2r and libpq 11.2 in wheels
2019-03-13 11:12:17 +00:00
Daniele Varrazzo
92ac3ba4fc
Bumped to version 2.8
2019-03-05 17:33:16 +00:00
Daniele Varrazzo
3ae9dfd545
Better link from docs to "json and jsonb" data types
2019-03-05 17:31:45 +00:00
Daniele Varrazzo
c929f20048
Fixed building with Python 3.8
...
Not released yet, and using an internal API, so for the moment better
not declare it supported.
Close #854
2019-03-05 17:30:52 +00:00
Daniele Varrazzo
be7e1916d7
Dropped outdated setup.py comment
2019-02-26 23:48:20 +00:00
Grey Baker
7fadb75097
Add project_urls to setup.py, with links to source and documentation
2019-02-26 23:44:32 +00:00
David Fischer
147ff65e4a
Fix typo
2019-02-26 11:33:48 +01:00
Daniele Varrazzo
b17670a27e
Merge branch 'info-dsn-params'
2019-02-17 10:55:12 +00:00
Daniele Varrazzo
a68df50c7b
Added ConnectionInfo.dsn_parameters attribute
2019-02-17 02:37:09 +00:00
Daniele Varrazzo
0eb4560771
Don't use versions such as 2.8.0 in docs
...
Use 2.8.
2019-02-17 01:51:06 +00:00
Daniele Varrazzo
599432552a
Copyright year updated
...
ag -l Copyright | xargs sed -i \
"s/\(.*copyright (C) [0-9]\+\)\(-[0-9]\+\)\?\(.*\)/\1-$(date +%Y)\3/I"
2019-02-17 01:36:36 +00:00
Daniele Varrazzo
d177fa9bd0
Allow building docs with Python 3
...
Use a .pth file to simplify finding the just-built psycopg package into the
docs building env.
2019-02-17 01:36:36 +00:00
Daniele Varrazzo
63ce5ca94f
Fixed title level of sqlsate errors table in docs
2019-02-17 01:07:47 +00:00
Daniele Varrazzo
f70d6fd0ed
Dropped text docs generation
2019-02-17 00:58:27 +00:00
Daniele Varrazzo
e5e8cec350
Added table of sqlstate exceptions in the docs
...
Note that the column-spanning cells break text docs. I don't think
anybody cares about them, so going to drop them.
2019-02-17 01:55:14 +01:00
Daniele Varrazzo
d08be18671
Merge branch 'libpq-ptrs'
2019-02-17 00:17:43 +01:00
Daniele Varrazzo
6bbfce7b89
Skip password encryption test if libpq < 10
2019-02-16 22:57:16 +01:00
Daniele Varrazzo
80b7b845d2
Added docs about pgconn_ptr, pgresult_ptr
2019-02-16 18:12:52 +01:00
Daniele Varrazzo
3b7c083c3d
Skip tests involving ctypes on Windows
...
No idea about how to import libpq.
2019-02-16 18:12:52 +01:00
Daniele Varrazzo
7c7bbb9742
Added connection.pgconn_ptr and cursor.pgresult_ptr
...
Allow interacting with libpq in Python via ctypes.
See #782 .
2019-02-16 18:12:52 +01:00
Daniele Varrazzo
1dd8c7435f
Mention binary packages no longer installed by default in NEWS
...
Also fixed an unrelated typo.
[skip ci]
2019-02-16 16:10:03 +01:00
Daniele Varrazzo
495ff79f23
Preparing 2.8 beta release
2019-02-16 14:06:18 +01:00
Daniele Varrazzo
16b35ac77b
Merge remote-tracking branch 'origin/errors-module-c'
2019-02-16 13:05:20 +01:00
Daniele Varrazzo
7c148ecee4
Improvements to errors module docs
2019-02-11 01:20:21 +00:00
Daniele Varrazzo
3de4d17519
Fixed use of StandardError in test
...
In Py3 it's gone.
2019-02-11 00:26:01 +00:00
Daniele Varrazzo
99f680b6fe
Allow importing _psycopg even if the 'errors' module is not available
2019-02-10 04:25:06 +00:00
Daniele Varrazzo
30c1befa64
SQLSTATE error classes implemented in C
...
The module is only used to export them to Python.
2019-02-10 03:45:14 +00:00
Daniele Varrazzo
f1e73507d0
Merge remote-tracking branch 'origin/fast-namedtuple'
...
Close #838
2019-02-06 02:42:10 +00:00
Daniele Varrazzo
35ec7ad9c1
Use a proper LRU cache for namedtuples
...
Previous one didn't refresh by last use. Use the stdlib version for py3
and one of our own for py2.
Max size set to 512, which should be fine for everyone (tweaking is
still possible by monkeypatching, as the tests do, but I don't want to
make an interface of it).
2019-02-02 19:29:20 +00:00
Daniele Varrazzo
805527fcd6
Added caching of types generated by NamedTupleCursor
...
see #838
2019-02-02 14:22:25 +00:00
Daniele Varrazzo
3f20f7934a
Merge branch 'drop-display-size'
2019-01-25 17:31:55 +00:00
Daniele Varrazzo
4298718978
Dropped PSYCOPG_DISPLAY_SIZE build parameter
...
Big and complex _pq_fetch_tuples simplified by moving per-column
calculation to a separate function.
2019-01-25 17:31:39 +00:00
Daniele Varrazzo
00cb2636f5
Merge branch 'module-init-cleanup'
2019-01-23 14:17:07 +00:00
Daniele Varrazzo
65a2a18a1b
General cleanup of module init shenanigans
...
Pass around the module instead of its dict (getting the latter is fast
if needed), mark function raising with negative results, check all errors,
consistent names...
2019-01-23 09:46:18 +00:00
Daniele Varrazzo
66d5c6da07
Incref an object which will be held forever in a static var
2019-01-23 09:46:18 +00:00
Daniele Varrazzo
e9c476266c
Decrement the refcount of temporary objects in module init failed
...
We are going to die anyway, but let's do it in style.
2019-01-22 19:40:42 +00:00
Daniele Varrazzo
63040e5134
Mention new OpenSSL version in wheel package
2019-01-22 12:25:03 +00:00
Daniele Varrazzo
1e6d5fb32d
Merge branch 'execute-locks'
2019-01-22 12:24:41 +00:00
Daniele Varrazzo
c34c99aa7f
Mention cursor locks cleanup in news file
2019-01-22 11:20:36 +00:00
Daniele Varrazzo
92e615a1a4
Assign the PGresult to the cursor in the execute critical section
...
Possible cause of the issue reported in #346 (in concurrent
environments).
2019-01-22 11:02:09 +00:00
Daniele Varrazzo
37891500d9
Split pq_execute into sync/async parts
2019-01-22 10:51:27 +00:00
Daniele Varrazzo
eab5d5d93f
Date/time modules initialized in separate functions
2019-01-22 09:09:07 +00:00
Daniele Varrazzo
111a71ccee
Dropped psyco_errors_fill()
...
Just use psyco_errors_init() for complete errors initialization
2019-01-21 20:18:53 +00:00
Daniele Varrazzo
1839806c3c
Dropped project wide type to define encodings table
2019-01-21 20:18:53 +00:00
Daniele Varrazzo
8f17ccf784
Dropped C API interface
...
I guess it was unused as it only contained two init functions. The
Capsule should do things better now I guess.
2019-01-21 20:18:53 +00:00
Daniele Varrazzo
7b2e8f0aa4
Respect refcount with PyModule_AddObject()
...
The function steals a ref. The module is never destroyed so things work
fine but the refcount is wrong.
2019-01-21 20:18:53 +00:00
Daniele Varrazzo
549beeea84
Module constants definition moved in a separate function for clarity
2019-01-21 20:18:53 +00:00
Daniele Varrazzo
4246fdf809
Merge remote-tracking branch 'origin/code-cleanup'
2019-01-21 12:49:05 +00:00
Daniele Varrazzo
e67028f4bc
Handle failed allocation in list adaptation
2019-01-21 02:49:38 +00:00
Daniele Varrazzo
7a3bce8fc3
Dropped funny handling of REPLICATION_* constants
2019-01-21 02:49:38 +00:00
Daniele Varrazzo
c77615adc9
_psyco_curs_execute() simplified
...
Dropped code duplications, more regular increc/decref pattern.
Check the return value of formatting named cursor: would have segfaulted
in case of error.
2019-01-21 02:49:38 +00:00
Daniele Varrazzo
594df09a63
More straightforward semantics for psyco_GetDecimalType
...
Raise an exception when returning NULL, leave the caller cleaning it.
2019-01-21 02:41:58 +00:00
Daniele Varrazzo
2ad2b27065
Dropped use of converter function to verify copy argument
...
They weren't really converters, and they confused the static checker
2019-01-21 02:41:58 +00:00
Daniele Varrazzo
3768d9047d
Mark psyco_set_error as returning a borrowed object
2019-01-21 02:41:58 +00:00
Daniele Varrazzo
7a1fb9a2e4
Added utils.h file
...
utils.c functions definition moved out of psycopg.h
Some utility functions defined into psycopgmodule.c moved into utils.c.
2019-01-21 02:41:58 +00:00
Daniele Varrazzo
daff2ea1be
Mark setter as raising on negative results
...
Fixed static check of psyco_conn_cursor().
2019-01-21 02:41:58 +00:00
Daniele Varrazzo
4644715164
Consider the case dereferencing weakref in conn_poll returns NULL
...
It shouldn't but handle the case to avoid a possible null pointer
dereferencing.
2019-01-21 02:41:58 +00:00
Daniele Varrazzo
5b28d7b9c9
Dropped possible wrong code path in conn_decode
...
It shouldn't happen for both cdecoder and pydecoder to be null,
but just in case...
2019-01-21 02:41:58 +00:00
Daniele Varrazzo
117f7d33f8
Wrap _Bytes_Resize into a function with clearer semantic
...
Limit the static checker hacking to a simpler function.
2019-01-21 02:00:04 +00:00
Daniele Varrazzo
f9b798aca9
Avoid unlikely leaks in case of memory errors in Bytes_Format
2019-01-21 02:00:04 +00:00
Daniele Varrazzo
2a05aa2c43
Move var setting into the only case using it
...
The original function was more complex than this. This refactoring
avoids a false positive in the static checker
2019-01-21 02:00:04 +00:00
Daniele Varrazzo
43d779966b
Avoid using PyErr_BadInternalCall as the static checker doesn't get it
2019-01-21 02:00:04 +00:00
Daniele Varrazzo
003fc6dde1
Use the real definition of Py_LOCAL_INLINE
2019-01-21 02:00:04 +00:00
Daniele Varrazzo
fe915ac461
Bytes_Format: use a couple of macros instead of functions
...
The type was already checked upstream in the func body.
2019-01-21 02:00:04 +00:00
Daniele Varrazzo
15cba69a20
psycopg_escape_string: don't make me cringe
...
Just reformatted.
2019-01-21 02:00:04 +00:00
Daniele Varrazzo
79de02d7d5
Stricter use of PyArg_ParseTuple typed objects
...
The function expect PyObject *, not subclasses.
2019-01-21 02:00:04 +00:00
Daniele Varrazzo
3e66022912
Respect PyCFunction signature in METH_NOARGS functions
...
A second parameter does exist, although it's always NULL.
2019-01-21 02:00:04 +00:00
Daniele Varrazzo
5b08dc45b1
Merge remote-tracking branch 'origin/register-bytes'
...
Close #835
2019-01-19 15:32:46 +00:00
Daniele Varrazzo
49777de74c
Added documentation for BYTES caster
2019-01-18 16:15:15 +00:00
Daniele Varrazzo
ddbe495d70
Added BYTESARRAY typecaster
2019-01-18 15:47:01 +00:00
Daniele Varrazzo
4ab4247189
Added test for BYTES typecaster
2019-01-18 15:10:17 +00:00
Daniele Varrazzo
fd31a7d41b
Fixed typecast definition order
...
Didn't notice that the order matter: the last typecaster registered is
the effective one so let STRING win over UNICODE and BYTES.
2019-01-18 15:09:20 +00:00
Daniele Varrazzo
f713dc9fc1
Preliminary test for a BYTES adapter.
...
Allow returning unparsed bytes from databases with mixed encodings. See
issue #519 .
2019-01-18 13:17:02 +00:00
Daniele Varrazzo
4a41c9a8cc
Merge pull request #828 from wbolster/patch-1
...
mention postgresql 11 in install docs
2019-01-08 12:21:18 +00:00
Daniele Varrazzo
07d9fb8718
Don't call CLEARPGRES on the cursor state without holding the gil
...
There is a chance it is executed by two different threads resulting in
issue #384 .
I havent't found any other case that may lead to double free.
2019-01-02 13:15:00 +01:00
Daniele Varrazzo
ddcf808d56
Couple of objects into NEWS entries converted into links
2018-12-27 15:04:43 +01:00
Daniele Varrazzo
b26a0b149d
Added # char to a few issues in news
...
Just a formatting thing #ocd #youdontcare #really.
2018-12-27 15:01:45 +01:00
Daniele Varrazzo
f3695e36c7
Merge remote-tracking branch 'eternalflow/execute-values-returning-clause-support'
2018-12-27 14:53:12 +01:00
Daniele Varrazzo
7c8d2f484e
Mention execute_values() fetch in news
2018-12-27 14:51:18 +01:00
Daniele Varrazzo
bde9fc6dea
Docs wordsmith for execute_values() fetch param
2018-12-27 14:42:58 +01:00
Daniele Varrazzo
6fdac46137
Some harmless adjustments in execute_values() code
...
No optional result, and create the list only if requred.
2018-12-27 14:39:13 +01:00
wouter bolsterlee
107f779061
mention postgresql 11 in install docs
2018-12-07 15:10:18 +01:00
Daniele Varrazzo
25fc044d13
Merge pull request #823 from jdufresne/dep-pool
...
Dropped deprecated PersistentConnectionPool
2018-12-05 11:32:20 +00:00
Daniele Varrazzo
de79aba66d
Merge pull request #819 from jdufresne/ctypes
...
Remove unnecessary test decorator 'skip_if_cant_cast'
2018-12-05 11:30:48 +00:00
Jon Dufresne
eb2d1766c6
Remove unnecessary test decorator 'skip_if_cant_cast'
...
ctypes is available and works on all supported Pythons. It has been
available since Python 2.5. The tests were written when Python 2.4 was
still supported.
2018-12-04 18:20:17 -08:00
Jon Dufresne
a1fdaebc30
Dropped deprecated PersistentConnectionPool
...
This class was deprecated in
27cd6c4880
(Dec 2, 2012), which was first
included in release 2.5. Enough time has passed for library uses to find
an alternative solution.
This class was untested.
2018-12-04 06:32:00 -08:00
Daniele Varrazzo
68bacbb194
Merge pull request #822 from jdufresne/decorate-all
...
Simplify 'decorate_all_tests' usage by decorating the test class
2018-12-04 14:22:02 +00:00
Daniele Varrazzo
672bdba679
Merge pull request #821 from jdufresne/skip-libpq
...
Remove workarounds for unsupported libpq < 9.1
2018-12-04 14:13:18 +00:00
Daniele Varrazzo
dc5298a919
Merge pull request #820 from jdufresne/appveyor
...
Remove Python 3.3 references from appveyor.yml
2018-12-04 14:11:53 +00:00
Daniele Varrazzo
b233778acd
Merge pull request #818 from jdufresne/bool-simplify
...
Simplify PyBool usage with Python convenience macros/functions
2018-12-04 14:07:48 +00:00
Jon Dufresne
a739c09f67
Simplify 'decorate_all_tests' usage by decorating the test class
...
Skip tests as early as possible by decorating the whole class with
unittest.skipIf instead of every test method individually.
2018-12-01 19:40:27 -08:00
Jon Dufresne
8b543eaa92
Remove Python 3.3 references from appveyor.yml
...
Python 3.3 has been unsupported since
c2d082e896
.
2018-12-01 09:11:35 -08:00
Jon Dufresne
17dc5a85a3
Remove workarounds for unsupported libpq < 9.1
...
Per http://initd.org/psycopg/docs/install.html#prerequisites :
> PostgreSQL client library version from 9.1
2018-12-01 08:58:39 -08:00
Jon Dufresne
b796ca0c0a
Simplify PyBool usage with Python convenience macros/functions
...
https://docs.python.org/3/c-api/bool.html
2018-11-30 17:09:30 -08:00
Ivan Kotelnikov
2e591e27f2
add versionchanged to docs
2018-11-24 20:51:18 +02:00
Ivan Kotelnikov
b40ac15efc
rename param name to fetch
2018-11-24 20:51:18 +02:00
Ivan Kotelnikov
e2b99d3a8e
write test for fetch_result flag
2018-11-22 12:30:37 +02:00
Ivan Kotelnikov
9a8d7d5a6a
add RETURNING clause support in execute_values function
2018-11-21 16:38:13 +02:00
Daniele Varrazzo
483901ea7b
Merge branch 'fix-591'
2018-11-16 19:17:24 +00:00
Daniele Varrazzo
73a680f45d
Convert int subclasses to long before adapting
...
Fixes adaptation of int/long subclasses whose str() is not the number,
such IntEnum
Close #591
Note that I thought it would have needed a new adapter, so I considered
it a new feature. But it is more a shortcoming of the int adapter
failing to do something reasonable (poor Liskov, always mistreated) so I
may actually backport it if there is a new 2.7 release.
2018-11-16 18:16:03 +00:00
Daniele Varrazzo
654be4784c
Dropped examples dir (and some leftover reference to the sandbox dir)
...
Close #645 .
2018-11-16 17:06:06 +00:00
Daniele Varrazzo
f9d6430ae4
Mentioning binary packages fixes in news file
2018-11-10 23:48:47 +00:00
Daniele Varrazzo
3279ff7507
Mention get_native_connection()
in the news file
2018-11-09 11:40:17 +00:00
Daniele Varrazzo
991b0e02c5
Fixed NEWS file after I actually re-read it for release.
2018-11-09 11:33:03 +00:00
Federico Di Gregorio
aee6f9352b
Merge pull request #805 from fogzot/feature-expose-pgconn
...
Feature expose pgconn
2018-11-08 15:57:23 +01:00
Federico Di Gregorio
01f8475f53
Merge branch 'master' into feature-expose-pgconn
2018-11-07 14:15:29 +01:00
Daniele Varrazzo
d1aa1585a1
Merge branch 'fix-788'
2018-10-30 10:50:25 +00:00
Daniele Varrazzo
a83696fc50
Fixed adaptation of lists of empty lists
...
...somehow. Postgres doesn't support them and converts them into a
simple empty array. However this is not really our concern: the syntax
we return is valid.
Close #788
2018-10-30 01:48:51 +00:00
Daniele Varrazzo
2f24a2e22d
Use class decorators to decorate all tests
...
Test decorators changed so that they can be applied either to a method
or to a class. Of course their double nature is implemented by a
decorator.
2018-10-30 00:23:56 +00:00
Daniele Varrazzo
60935b9b3d
Merge remote-tracking branch 'origin/fix-794'
2018-10-23 12:09:32 +01:00
Daniele Varrazzo
8fb0f694f7
Don't barf on Composite passed to execute_values()
...
Close #794
2018-10-23 01:57:48 +01:00
Daniele Varrazzo
05f9e231a0
Full flake8 3.5 cleanup
2018-10-23 00:39:14 +01:00
Daniele Varrazzo
1bb3d5cfe2
Dropped duplicate classes in errors module
...
Also using a more compact class registration using a decorator
2018-10-23 00:31:57 +01:00
Daniele Varrazzo
fae4284a64
Minimal formatting tweak to last news
2018-10-15 01:36:55 +01:00
Daniele Varrazzo
0236c68da9
Merge branch 'connection-info'
2018-10-15 01:24:00 +01:00
Daniele Varrazzo
c567556d71
Fixed NEWS file to mention the connection.info object
2018-10-15 01:23:51 +01:00
Daniele Varrazzo
b205764fdd
Merge branch 'master' into errors-module
2018-10-15 00:58:32 +01:00
Daniele Varrazzo
e7227ce87b
Added errors.lookup() function
2018-10-15 00:56:51 +01:00
Daniele Varrazzo
5da968d6f6
Added documentation for the errors module
2018-10-15 00:48:44 +01:00
Daniele Varrazzo
61df7bdd8d
Errors module content updated to Postgres 11
2018-10-14 23:07:11 +01:00
Daniele Varrazzo
7a5edff6c6
errorcodes map update to PostgreSQL 11
2018-10-14 22:57:48 +01:00
Daniele Varrazzo
44bd2927c5
Use the connection.info properties instead of the legacy methods
2018-10-13 03:28:42 +01:00
Daniele Varrazzo
704e6797e7
Guard from some info functions not available in some libpq versions
2018-10-13 03:09:39 +01:00
Daniele Varrazzo
d138e42ee5
Added ConnectionInfo.parameter_status()
2018-10-13 02:40:17 +01:00
Daniele Varrazzo
9f6a3a5e96
Added ConnectionInfo.ssl_attribute()
2018-10-13 02:21:38 +01:00
Daniele Varrazzo
cb3d5f9d92
Added all the missing ConnectionInfo attributes
2018-10-13 01:36:07 +01:00
Daniele Varrazzo
4f7bbdca26
Added missing class signatures in the docs
2018-10-13 00:55:20 +01:00
Daniele Varrazzo
795522ff2b
Merge branch 'fix-790'
2018-10-13 00:47:25 +01:00
Daniele Varrazzo
439dff974d
Added ConnectionInfo.error_message
2018-10-13 00:47:04 +01:00
Daniele Varrazzo
d29aa1c437
Fixed refcount in connection's readonly and deferrable getters
...
Close #790
2018-10-12 23:32:13 +01:00
Daniele Varrazzo
1ac6359fef
Added other members to the ConnectionInfo class
...
Starting deprecating softly some of the methods bloating the connection
class.
2018-10-12 04:18:59 +01:00
Daniele Varrazzo
0a04c8892d
Added several ConnectionInfo attributes
2018-10-12 04:18:59 +01:00
Daniele Varrazzo
9ddf59959f
Adding ConnectionInfo object documentation
...
I'm still fought whether docs should be in the C module or in the .rst.
I'd prefer the first because DRY, but writing multiline strings in C
really sucks.
2018-10-12 03:25:06 +01:00
Daniele Varrazzo
0e2b516a3c
Moving host attribute to a connection.info object
2018-10-11 22:42:52 +01:00
Daniele Varrazzo
7619c91d62
Merge branch 'description-extra-attrs'
2018-10-11 04:39:14 +01:00
Daniele Varrazzo
6b3d3604bf
Added docs for the Column object
2018-10-11 04:27:42 +01:00
Daniele Varrazzo
f99a8de6d0
Added table_oid, table_column on cursor.description items
...
Close #661
2018-10-11 03:37:09 +01:00
Daniele Varrazzo
b3b225a9da
Added C implementation for a Column type
...
Currently behaving exactly like the previous (named)tuple.
2018-10-11 02:59:45 +01:00
Daniele Varrazzo
e00c4e2a7f
Merge branch 'fix-copy-async-hangs'
2018-10-10 23:58:24 +01:00
Daniele Varrazzo
c314512115
Fixed infinite loop in pq_get_last_result after COPY
...
There will be an error downstream but we have to get out of this
function first.
Close #781
2018-10-10 23:57:34 +01:00
Daniele Varrazzo
c442b3ec46
Merge pull request #771 from jdufresne/distutils
...
Drop legacy distutils fallback in setup.py
2018-10-10 22:18:22 +01:00
Daniele Varrazzo
9c905741da
Merge branch 'https'
2018-10-10 22:16:23 +01:00
Daniele Varrazzo
5010a65d77
Another url changed to https
...
Added after this MR.
2018-10-10 22:15:45 +01:00
Daniele Varrazzo
9148157697
Merge branch 'master' into https
2018-10-10 22:07:33 +01:00
Daniele Varrazzo
2e823273d6
Merge pull request #789 from jdufresne/argparse
...
Replace deprecated optparse usage with argparse
2018-10-10 22:05:16 +01:00
Daniele Varrazzo
cd9d74c462
Merge branch 'conn-get-host'
2018-10-10 22:03:36 +01:00
Daniele Varrazzo
382eeccab8
Small tweaks to connection.host docs
2018-10-10 22:02:20 +01:00
Daniele Varrazzo
f5f6b420b2
Merge remote-tracking branch 'origin/diag-schema-name-nonloc'
2018-10-10 21:46:51 +01:00
Jon Dufresne
488818eeb6
Replace deprecated optparse usage with argparse
...
Per https://docs.python.org/3/library/optparse.html
> Deprecated since version 3.2: The optparse module is deprecated and
> will not be developed further; development will continue with the
> argparse module.
2018-10-10 05:15:57 -07:00
Federico Di Gregorio
296c80d1f2
Commented out test to avoid beaking master
2018-10-10 11:05:02 +02:00
Federico Di Gregorio
1fe9f1ac5b
Fixed test for issue #788
2018-10-10 09:35:18 +02:00
Federico Di Gregorio
ebcfbe03f9
Added test for issue #788
2018-10-10 09:14:56 +02:00
Federico Di Gregorio
7806fc736a
Sandbox removed
...
The sandbox directory was there to test issues before we had full test
coverage and to try quick and dirty Python snippets before moving them to
the examples directory, sending them to mailing list or copying them to
the docs. Almost anything that was in sandbox is now in the examples
directory or has been refactored into a full test, or is so old that is
of no use anymore. So, adieu sandbox.
2018-10-09 00:00:12 +02:00
Federico Di Gregorio
e3c791cf60
Merge pull request #786 from alandmoore/master
...
Add documentation about the use of backslashes with LIKE
2018-10-08 23:50:33 +02:00
Alan D Moore
20647b7bcc
Fix RST markup
2018-10-08 09:40:51 -05:00
Alan D Moore
67b94d0797
Added note about backslashes and LIKE
...
Added note about the use of LIKE with strings containing
backslashes. Addresses concern in issue #785 .
2018-10-08 09:36:16 -05:00
Federico Di Gregorio
f56392a245
Allow SPHINXBUILD on command line
2018-10-07 13:55:11 +02:00
Federico Di Gregorio
81addddaee
Added connection.get_native_connection()
2018-10-07 13:54:24 +02:00
Marco De Paoli
1c553bb703
Added connection.host
...
Return the server host name of the current connect.
2018-10-06 15:19:01 +02:00
Daniele Varrazzo
4e0b2ec9c9
Added Diagnostics.severity_nonlocalized attribute
...
Close #783 .
2018-10-04 16:13:46 +01:00
Daniele Varrazzo
9d83b03605
Merge branch 'identifier-sequence'
2018-10-04 13:22:46 +01:00
Daniele Varrazzo
4aa02b7855
sql.Identifier can wrap a sequence of strings to represent qualified names
...
Close #732 .
2018-10-04 12:46:10 +01:00
Daniele Varrazzo
695c757dc3
Merge branch 'stringification-of-ranges'
2018-10-04 12:24:27 +01:00
Daniele Varrazzo
81d6f7a7ca
Mention the better str(Range) in the docs.
2018-10-04 11:57:31 +01:00
Daniele Varrazzo
8bd7ad7bb5
Faster check for empty range in str()
2018-10-04 11:46:07 +01:00
Michel Albert
d317977205
Implement __str__ for range types
2018-09-30 10:15:55 +02:00
Federico Di Gregorio
ccae5cae34
Expose PGconn* raw pointer on the connection as a PyCapsule
2018-09-27 10:15:40 +02:00
Jon Dufresne
b07e34e0b8
Prefer https:// URLs when available
2018-09-22 19:02:33 -07:00
Jon Dufresne
9405d8cbc5
Drop legacy distutils in setup.py
...
distutils is not recommended for use and unnecessary for modern Python
environments. Use only setuptools instead. From
https://docs.python.org/3/library/distutils.html :
> Most Python users will not want to use this module directly, but
> instead use the cross-version tools maintained by the Python Packaging
> Authority. In particular, setuptools is an enhanced alternative to
> distutils ...
>
> The recommended pip installer runs all setup.py scripts with
> setuptools, even if the script itself only imports distutils. Refer to
> the Python Packaging User Guide for more information.
2018-09-15 16:05:05 -07:00
Daniele Varrazzo
6b6b1a6e8d
Merge branch 'fix-bsd'
2018-09-07 23:58:19 +01:00
Daniele Varrazzo
0eaa0c9d4e
Mention FreeBSD build fixed in news file
2018-09-07 23:57:34 +01:00
Dmitry Marakasov
5ec573c83b
Remove obsolete and incorrect FreeBSD version condition
...
The FreeBSD-related condition which enables custom round() implementation is incorrect: one must include <sys/param.h> to get __FreeBSD_version value, and since it's not included here, the check succeeds while it shouldn't. Before it worked somehow, but since python 3.7 it results in conflicting declarations of round(). The condition is also no longer needed since FreeBSD 5.3 is unsupported for 12 years.
2018-09-07 23:57:33 +01:00
Daniel Hahler
6af55ee51c
Improve doc for extras.wait_select
2018-09-05 16:45:33 +01:00
Andrew King
03fc3f9a2a
Fix typo in install.rst
2018-09-05 16:42:59 +01:00
Jon Dufresne
c57fee2c92
Update intersphinx URLs to point to Python 3 docs
...
Python 3 docs are more up to date and reflect the future of Python.
Removed unused py3 marker.
2018-09-05 16:21:14 +01:00
Benjamin Peterson
f86229d98b
Remove setup.py fallback that assumes postgres 7.4.0.
...
pyscopg2 only supports postgres >= 9.1 these days. Thus, taking this fallback will only lead to failure later down the line.
2018-09-05 16:18:18 +01:00
Daniele Varrazzo
344ce15261
Better testing of encryption function with libpq < 10
2018-08-17 02:09:22 +01:00
Daniele Varrazzo
782fa39647
Generating the whole errors file from script
2018-08-17 02:00:40 +01:00
Daniele Varrazzo
0bce58d0cd
Dropped parsing sgml files for error codes
...
The errcodes.txt file contains all the errors for the currently
maintained server versions. There is only one error code missing,
probably unused, but adding it back anyway to keep the errcode module
unchanged.
2018-08-17 02:00:40 +01:00
Daniele Varrazzo
ce1ac3aea9
Read exceptions to raise from a Python module
2018-08-17 02:00:01 +01:00
Daniele Varrazzo
153b0983c1
Merge branch 'fix-746'
2018-07-25 16:29:57 +01:00
Daniele Varrazzo
97a4fb92c6
Fixed compile error on windows
...
Because const int + 1 is not const, right???
Also fixed other occurrences of magic numbers and failed DRY around
PyOS_snprintf() calls.
2018-07-24 21:16:36 +01:00
Daniele Varrazzo
466efe4461
Bump tests for selective closure of named cursor to pg 8.2
...
Previous versions don't support the features as they don't have the
pg_cursors view. But they are too old to care.
2018-07-24 21:16:36 +01:00
Daniele Varrazzo
6d8f4f9f0d
Close named cursor if exist, even if we didn't run execute
...
Close #746
2018-07-24 21:16:36 +01:00
Daniele Varrazzo
0e89b9de2c
Merge branch 'py37'
2018-07-13 19:12:23 +01:00
Daniele Varrazzo
a8b9c9971e
Consider PG 9.3 a thing of the past.
...
Wow, it seems yesterday...
Previosly archived as a "past" version only in the prepare script. Test
script consistent now.
[skip ci]
2018-07-13 19:11:56 +01:00
Daniele Varrazzo
82f52db9b3
Fetch the correct testing postgres packages on xenial
2018-07-13 18:25:07 +01:00
Jon Dufresne
61e644049f
Add testing and document support for Python 3.7
...
Python 3.7 was released on June 27, 2018.
https://docs.python.org/3/whatsnew/3.7.html
2018-07-12 18:07:25 -07:00
Daniele Varrazzo
6becf0ef55
Note the upgrade in wheel dependencies in NEWS file
2018-05-23 21:51:49 +01:00
Daniele Varrazzo
0aa7e21f91
Added note adivising against depending on the -wheels package
2018-05-23 21:43:48 +01:00
Daniele Varrazzo
a339ec3d8f
Dropped license paragraph applying to removed files
2018-05-23 21:20:38 +01:00
Daniele Varrazzo
166ad21e5c
Merge branch 'drop-2to3'
2018-05-21 03:36:32 +01:00
Daniele Varrazzo
0bb7d0db48
DictCursor and RealDictCursor rows maintain columns order
...
Close #177 .
2018-05-21 03:14:08 +01:00
Daniele Varrazzo
7bdaf0affd
Restored methods iter*() on dict cursors rows
2018-05-21 02:51:37 +01:00
Daniele Varrazzo
e8a831dda2
Merge branch 'master' into drop-2to3
2018-05-20 23:56:29 +01:00
Daniele Varrazzo
a0f7027ad5
Added tests to verify iter methods on dict cursors
...
ISTM the refactoring in #648 broke something
2018-05-20 23:55:18 +01:00
Daniele Varrazzo
82ae44ac3a
DictCursor/RealDictCursor tests split
2018-05-20 23:35:26 +01:00
Daniele Varrazzo
f947c0e6be
Merge branch 'encrypt-pass'
2018-05-20 22:33:07 +01:00
Daniele Varrazzo
9eb3e0cb79
encrypt_password() reported in the news file
2018-05-20 22:31:22 +01:00
Daniele Varrazzo
9cf658ec6e
Fixed refcount handling in encrypt_password
...
Added tests to check bad types, which discovered the above problem: on
type error we would have decref'd on exit something that was only
borrowed (because we wouldn't have performed matching increfs).
2018-05-20 21:18:36 +01:00
Daniele Varrazzo
abca14d601
Fixed keywords support for encrypt_password and tests completed
2018-05-20 20:50:04 +01:00
Daniele Varrazzo
9e4f89a2a1
encrypt_password docs moved to extension module and updated
2018-05-20 20:13:04 +01:00
Daniele Varrazzo
a3063900ee
Fixed code flow in encrypt_password()
...
Fixed several shortcomings highlighted in #576 and not fixed as
requested.
Also fixed broken behaviour of ignoring the algorithm if the connection
is missing.
2018-05-20 19:18:42 +01:00
Daniele Varrazzo
0161d54dbb
Merge branch 'master' into encrypt-pass
2018-05-20 17:57:34 +01:00
Jon Dufresne
a8d4f37b19
Complete tox testing matrix
...
Now tests all supported Python environments as well. Allows testing the
full matrix of Python version with a single command.
Include the command make in the whitelist_externals configuration to
avoid the runtime warning:
WARNING:test command found but not installed in testenv
cmd: /usr/bin/make
env: .../psycopg2/.tox/flake8
Maybe you forgot to specify a dependency? See also the whitelist_externals envconfig setting.
2018-05-20 17:53:49 +01:00
Jon Dufresne
9ceffa1cc6
Update all pypi.python.org URLs to pypi.org
...
For details on the new PyPI, see the blog post:
https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.html
2018-05-20 17:22:37 +01:00
Daniele Varrazzo
10caf1bd74
Command to upload docs on pythonhosted dropped altogether
2018-05-20 17:21:26 +01:00
Daniele Varrazzo
a110d7dd70
Intersphinx urls to generate Python links updated
...
Previous urls warn about a redirect, so they are probably to go.
2018-05-20 17:21:26 +01:00
Daniele Varrazzo
3f0a7f9af4
Added license to the docs
...
Includes other docs improvements, such as the ones proposed in #711 .
2018-05-20 17:03:08 +01:00
Daniele Varrazzo
068b15c57f
Merge branch 'fix-716'
2018-05-20 17:00:13 +01:00
Daniele Varrazzo
aac8a20fc1
Merge branch 'fix-707'
2018-05-20 14:07:10 +01:00
Daniele Varrazzo
c4da939909
Don't raise an exception closing an unused named cursor
...
Close #716
2018-05-20 14:00:09 +01:00
Daniele Varrazzo
49d9edce01
Set minimal postgres version for intervalstyle test
2018-05-20 13:40:57 +01:00
Daniele Varrazzo
3f389593f5
Raise NotSupportedError fetching iso_8601 intervals
...
Previously it would have failed parsing and resulted in ValueError
Close #707
2018-05-20 13:22:38 +01:00
Daniele Varrazzo
098c00d73e
Merge remote-tracking branch 'nested-array-nulls'
2018-05-20 12:51:13 +01:00
Daniele Varrazzo
8c969304fd
Merge remote-tracking branch 'fix-211'
2018-05-20 12:50:22 +01:00
Daniele Varrazzo
dd7e5c906f
Skipped test on db version not supporting unicode identifiers
2018-05-18 12:16:43 +01:00
Daniele Varrazzo
eb570488a4
Test databases from newest to oldest
...
This way we can spot when a feature was not supported yet by the first
test failing.
2018-05-18 12:16:03 +01:00
Daniele Varrazzo
bc84b6233e
Allow non-ascii chars in namedtuple fields
...
They can be valid chars in Python 3. Or maybe not? In which case Python
will throw an exception, but that's fine.
Fix regression introduced fixing #211
2018-05-18 12:15:50 +01:00
Daniele Varrazzo
8dd00ee874
Hstore test fixed after adapting arrays dropped space after commas
2018-05-18 12:11:02 +01:00
Daniele Varrazzo
b5e4a040f8
Fixed adaptation of arrays of arrays of nulls
...
Close #325 , close #706 .
2018-05-18 12:10:20 +01:00
Daniele Varrazzo
548e281350
Merge pull request #715 from hroncok/py37
...
Travis CI: Run tests on Python 3.7
2018-05-18 12:07:03 +01:00
Miro Hrončok
b52ff10153
Travis CI: Run tests on Python 3.7
...
Also, switch to wheel, because eggs caused problems on 3.7:
ValueError: bad marshal data (unknown type code)
2018-05-18 12:12:09 +02:00
Ashesh Vashi
36f0db81d2
Fixed the string format error reported by Travis-CI.
...
Reference: https://travis-ci.org/psycopg/psycopg2/jobs/376288585
2018-05-08 15:29:16 +05:30
Ashesh Vashi
1bec2bdc43
Merge branch 'master' into master
2018-05-08 15:17:59 +05:30
Daniele Varrazzo
90b26c3e23
Merge branch 'fix-679'
2018-02-21 12:05:06 +00:00
Daniele Varrazzo
ea923b63a4
Allow strings subclasses in ensure_bytes
...
Fix #679
2018-02-21 10:27:28 +00:00
Daniele Varrazzo
0a5db6ecf5
Merge branch 'expand-version'
2018-02-19 13:54:11 +00:00
Daniele Varrazzo
ede418a009
Report MSYS2 build probably fixed
2018-02-19 13:53:50 +00:00
Daniele Varrazzo
32f5a9fc1d
Avoid quoting the string in the psycopg version macro
...
Use a macro trick to add the quotes. This seems more portable than
passing the quotes to the command line (see #658 ).
https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html
2018-02-19 13:53:50 +00:00
Daniele Varrazzo
750ececf08
Merge branch 'fix-solaris-11'
2018-02-19 11:43:59 +00:00
Daniele Varrazzo
8670287928
Added Solaris 11 fix to news file
2018-02-19 11:43:37 +00:00
Mike Gerdts
f766d90704
Fixed building on SmartOS
...
timeradd is missing on Solaris 10, but is present as a macro in
<sys/time.h> on SmartOS, illumos, and likely Solaris 11.
2018-02-19 11:40:05 +00:00
Daniele Varrazzo
df952c149d
Fixed pip invocation example to skip binary packages
...
Close #673
2018-02-09 16:12:29 +00:00
Daniele Varrazzo
5309da117d
Autocommit shouldn't change deferrable on servers not supporting it
...
Regression on unsupported Postgres versions after fixing bug #580
2018-02-08 15:00:38 +00:00
Daniele Varrazzo
c52e49a9da
Report Python 2.6 wheels no more available
...
[skip ci]
2018-01-29 12:58:28 +00:00
Daniele Varrazzo
1436ee308c
Link psycopg2-binary package to PyPI in readme
...
Note: the package doesn't exist yet...
2018-01-29 03:31:49 +00:00
Daniele Varrazzo
9e6b22cc3b
Merge branch 'namedtuple-invalid-identifiers'
2018-01-29 03:31:10 +00:00
Daniele Varrazzo
ddb87b7727
Convert fields names into valid Python identifiers in NamedTupleCursor
...
Close #211 .
2018-01-29 03:30:46 +00:00
Daniele Varrazzo
3354bbd1b6
Merge branch 'openssl-1.0.2n'
2018-01-29 03:27:31 +00:00
Daniele Varrazzo
957fd79a27
Build using OpenSSL 1.0.2n
2018-01-29 03:27:08 +00:00
Daniele Varrazzo
8cc0d06e65
Define openssl and libpq versions in vars in appveyor build
2018-01-29 03:27:08 +00:00
Daniele Varrazzo
4845393c15
Build env vars on windows less verbose
...
Copied from psycopg2-wheels
2018-01-29 03:27:08 +00:00
Daniele Varrazzo
f85e405605
Merge branch 'separate-binary'
2018-01-29 03:24:45 +00:00
Daniele Varrazzo
f976c428d2
Mention new wheel packages in news file
...
Close #543 .
2018-01-29 03:23:59 +00:00
Daniele Varrazzo
76f3e196d3
Silence warning on import failing a test
2018-01-29 03:23:59 +00:00
Daniele Varrazzo
5b69adf797
Document the psycopg2-binary package
2018-01-29 03:23:59 +00:00
Daniele Varrazzo
aa2c172706
Print info about the binary package on build failed
...
The idea is to release a package 'psycopg2-binary' to allow installing
binary, and leave the psycopg2 package to be source only, to avoid
pushing the unreliability of the wheel pacakge by default (see issue #543 ).
Version number bumped to test with new packages.
2018-01-29 03:22:59 +00:00
Daniele Varrazzo
8decf34ad7
Dropped warning about unsafe cursor names
...
It was long made secure
2018-01-25 22:00:40 +00:00
Daniele Varrazzo
da2aba1595
Merge branch 'fix-idempotence-check'
2018-01-11 02:41:38 +00:00
Daniele Varrazzo
74d2c4bef9
Fixed idempotence check changing connection characteristics
2018-01-11 02:23:27 +00:00
Daniele Varrazzo
6da3e7ee69
Merge branch 'mogrify-on-closed-cursor'
2018-01-11 00:16:01 +00:00
Daniele Varrazzo
ddef2e30cd
'key' docs in getconn() improved
...
Fix #569 .
2018-01-11 00:14:36 +00:00
Daniele Varrazzo
a78ac3c125
Fixed test in asian time zones
...
Fix #652
2018-01-10 23:58:28 +00:00
Daniele Varrazzo
e0226fc46a
'cursor.mogrify()' can be called on closed cursors
...
Fix #579 .
2018-01-11 08:55:31 +09:00
Daniele Varrazzo
04f1f06b9f
Fixed stitch_text on Python 2
2018-01-10 22:49:00 +00:00
Daniele Varrazzo
bad9b8b383
Merge branch 'macro-accessors'
2018-01-10 22:47:59 +00:00
Daniele Varrazzo
b3a70e09e9
pypi3 fix noted in the news file
2018-01-10 22:44:37 +00:00
Daniele Varrazzo
77c703395b
Moved datatime compatibility macros with others
2018-01-10 22:29:16 +00:00
Daniele Varrazzo
e50f3129c2
Merge pull request #651 from ronnix/patch-1
...
Fix typo in comment in utils.c
2017-12-14 13:45:09 +00:00
Ronan Amicel
b8f2f71819
Fix typo in comment in utils.c
2017-12-14 14:00:36 +01:00
Glyph
3fcb035126
define a "polyfill" inline for python 2 compatibility
2017-12-12 03:15:21 -08:00
Glyph
852884e086
use accessor macros for pypy3 compatibility
2017-12-12 03:06:18 -08:00
Jon Dufresne
be3b1ba1eb
In tests, use compat.py where there is overlap
2017-12-11 20:27:52 -08:00
Jon Dufresne
8ad2098b74
Drop 2to3 build step; make all code compatible with all Pythons
...
Make all library code compatible with both Python 2 and Python 3. Helps
move to modern Python idioms. Can now write for Python 3 (with
workarounds for Python 2) instead of the other way around.
In the future, when it is eventually time to drop Python 2, the library
will be in a better position to remove workarounds
Added a very small comparability module compat.py where required. It
includes definitions for:
- text_type -- A type. str on Python 3. unicode on Python 2.
- string_types -- A tuple. Contains only str on Python 3. Contains str &
unicode on Python 2.
2017-12-11 20:26:58 -08:00
Jon Dufresne
f35465231f
Drop the Python 2 style interface from DictRow
...
Now standardizes on the Python 3 interface for all uses. Makes behavior
of DictRow between Pythons more consistent and predictable.
2017-12-11 20:02:16 -08:00
Jon Dufresne
3a6a8e96fb
User super() throughout DictRow class
...
Avoid calling parent method directly.
2017-12-11 19:01:38 -08:00
Daniele Varrazzo
2cd9a78a97
Gitignore env2/env3 envs too
2017-12-11 02:25:13 +00:00
Daniele Varrazzo
4be2b75816
Dropped PYTHONPATH propagation in 'make check'
...
Psycopg doesn't have other dependencies outside the stdlib so what's
there is probably just noise.
2017-12-11 02:22:02 +00:00
Daniele Varrazzo
f3d21c24fc
Merge pull request #644 from jdufresne/noinstall-tests
...
Avoid installing tests to site-packages
2017-12-11 02:20:56 +00:00
Jon Dufresne
389f6c08d9
Avoid installing tests to site-packages
...
For library end users, there is no need to install tests alongside the
package itself. This keeps the tests available for development without
adding extra packages to user's site-packages directory. Reduces the
size of the installed package. Avoids accidental execution of test code
by an installed package.
2017-12-10 10:55:58 -08:00
Jon Dufresne
c86e682153
Skip register_hstore(..., unicode=True) tests on Python 3
...
Per the functions documentation, this argument is not supported on
Python 3. Skip it during tests.
> :param unicode: if `!True`, keys and values returned from the database
> will be `!unicode` instead of `!str`. The option is not available on
> Python 3
Work towards moving tests outside of the installed package.
2017-12-10 10:51:07 -08:00
Jon Dufresne
1a8e992fcc
Use relative imports throughout tests
...
The tests relied on Python2 relative import semantics. Python3 changed
import semantics to always search sys.path by default. To import using a
relative path it must have a leading dot.
Forward compatible with newer Pythons.
Works towards the goal of moving tests outside of the installed package.
For more information, see PEP-328:
https://www.python.org/dev/peps/pep-0328/
2017-12-10 10:51:07 -08:00
Jon Dufresne
9de46e416e
Use print() function instead of print statement throughout project
...
Forward compatible with newer Pythons.
2017-12-10 10:51:07 -08:00
Jon Dufresne
ef64493b89
Fix use of "async" in test_cursor.py
...
"async" will be a keyword starting with Python 3.7. On Python 3.6, use
of "async" causes a deprecation warning. Use the alias "async_" instead.
2017-12-10 10:49:04 -08:00
Daniele Varrazzo
b42c35849b
Merge pull request #647 from jdufresne/drop-unused-scripts
...
Remove unused scripts maketypes.sh & buildtypes.py
2017-12-10 18:26:29 +00:00
Jon Dufresne
1047af03da
Remove unused scripts maketypes.sh & buildtypes.py
...
Refs #645
2017-12-10 09:57:43 -08:00
Daniele Varrazzo
afd7c6c284
Merge pull request #646 from jdufresne/drop-deprecated
...
Drop long deprecated function register_tstz_w_secs()
2017-12-10 17:43:01 +00:00
Jon Dufresne
19b1efd629
Drop long deprecated function register_tstz_w_secs()
...
Deprecated in commit b263fbf274
on
2010-01-13. The deprecation warning was first released in version 2.2.2.
The function used to register an alternate type caster for TIMESTAMP
WITH TIME ZONE to deal with historical time zones with seconds in the
UTC offset. These are now correctly handled by the default type caster,
so currently the function doesn't do anything.
2017-12-10 07:57:11 -08:00
Daniele Varrazzo
ec0a3d59a8
Merge branch 'goodbye-psycopg1'
2017-12-04 12:12:37 +00:00
Daniele Varrazzo
861e389fcf
Dropped psycopg1 module
2017-12-04 11:56:27 +00:00
Daniele Varrazzo
2218e73c28
Merge branch 'master' into ws
2017-12-02 14:47:29 +00:00
Daniele Varrazzo
7617e1dbf5
Dropped .sln file
2017-12-02 14:46:03 +00:00
Daniele Varrazzo
df646831d7
Merge remote-tracking branch 'jdufresne/egg-info'
2017-12-02 12:11:10 +00:00
Daniele Varrazzo
06396e5162
Merge remote-tracking branch 'jdufresne/import-unittest'
2017-12-02 12:10:26 +00:00
Daniele Varrazzo
aae5d6364f
Merge remote-tracking branch 'jdufresne/leading0'
2017-12-02 12:07:57 +00:00
Daniele Varrazzo
5a3cf32fe5
Merge remote-tracking branch 'jdufresne/next-func'
2017-12-02 12:07:47 +00:00
Daniele Varrazzo
2c5cad1525
Merge remote-tracking branch 'jdufresne/more-json'
2017-12-02 12:07:06 +00:00
Daniele Varrazzo
8f6d744b5d
Merge remote-tracking branch 'jdufresne/sorted'
2017-12-02 12:06:05 +00:00
Daniele Varrazzo
ccc3820f8e
Merge remote-tracking branch 'jdufresne/script-to-py3'
2017-12-02 12:05:53 +00:00
Jon Dufresne
699be52e8b
Remove unnecessary script_to_py3; make scripts compatible instead
...
Part of the work towards moving tests out of the installed package.
2017-12-01 22:50:16 -08:00
Jon Dufresne
94bb238b70
Remove sorted() workaround; available on all supported Pythons
...
Introduced in Python 2.4 and the oldest supported Python is 2.7.
https://docs.python.org/2/library/functions.html#sorted
2017-12-01 22:03:38 -08:00
Jon Dufresne
e335d6d223
Trim trailing whitespace from all files throughout project
...
Many editors automatically trim whitespace on save. By trimming all
files in one go, makes future diffs cleaner without extraneous
whitespace changes.
2017-12-01 21:42:14 -08:00
Jon Dufresne
d0c7126aa8
Remove test decorators for json module
...
The json module is available in all Python versions supported by
psycopg2. No need to check for its presence when executing tests.
Should have been included with d58844e548
but was missed.
2017-12-01 21:06:10 -08:00
Jon Dufresne
f5703dc3e5
Use builtin function next() throughout project
...
Available since Python 2.6. Use of .next() is deprecated and not
supported in Python 3. Forward compatible with modern Python.
https://docs.python.org/2/library/functions.html#next
2017-12-01 19:57:37 -08:00
Jon Dufresne
56ec575351
Drop leading 0's from numeric literals
...
Not compatible with Python3. Makes the code more forward compatible with
modern Pythons.
In Python2, it was an alternative syntax for octal.
$ python3
>>> 01
File "<stdin>", line 1
01
^
SyntaxError: invalid token
2017-12-01 19:00:53 -08:00
Jon Dufresne
fcc083dc12
Always import the system unittest
...
There is no need to import testutils.unittest instead of simply
unittest. They are simple aliases. Use system unittest to be more
regular, consistent as well as idiomatic with the wider Python
community.
2017-12-01 18:35:30 -08:00
Jon Dufresne
6a1546adde
Add *.egg-info directories to .gitignore
2017-12-01 18:21:50 -08:00
Daniele Varrazzo
a51160317c
Fixed NEWS file entries
...
- 2.6.3 has not been released (yet). Fixes for bug #420 , bug #462 were
relased in 2.7.
- Added missing report for bug #489 fixed in 2.7.
2017-12-01 16:29:29 +00:00
Daniele Varrazzo
f4aa40da09
Merge branch 'bug-633'
2017-11-29 15:42:29 +00:00
Daniele Varrazzo
65ed5478d1
Collect rowcount in executemany even when discarding results
...
Closes #633 .
2017-11-29 15:42:04 +00:00
Daniele Varrazzo
727b952a32
Build and test packages with libpq 10.1 and OpenSSL 1.0.2m
2017-11-28 17:19:55 +00:00
Daniele Varrazzo
0d5b0f0287
Merge branch 'fix-libpq-version'
2017-11-28 17:19:30 +00:00
Daniele Varrazzo
87da2f898d
Fixed __libpq_version__ for Postgres >= 10.1
...
The version should be considered as 10.0.1; the number was generated as
10.1.0 instead.
Version number bumped to test building new wheels packages.
Fix #632 .
2017-11-28 17:19:01 +00:00
Daniele Varrazzo
3e52b5445b
Merge branch 'rm-eol'
...
Fix #626 , close #628 .
2017-11-28 16:27:41 +00:00
Daniele Varrazzo
f939f39580
Use dict comprehensions
2017-11-28 16:11:06 +00:00
Daniele Varrazzo
c3ee9cac41
Dropped unused test functions
2017-11-28 16:11:06 +00:00
Daniele Varrazzo
a0229cff82
Documentation tweaked to omit Python 2.6 distinctions
2017-11-28 16:11:06 +00:00
Hugo
60b1517c55
Add news and update version check
2017-11-28 16:11:02 +00:00
Hugo
c2d082e896
Drop support for EOL Python 3.0-3.3
2017-11-28 16:06:55 +00:00
Hugo
ea76504cd1
Remove trailing semicolons
2017-11-28 16:06:55 +00:00
Hugo
283de27098
Remove redundant parentheses
2017-11-28 16:06:52 +00:00
Hugo
08b479bc10
__slots__ should be a tuple
2017-11-28 16:05:59 +00:00
Hugo
7282ef0d14
Rewrite list creation as list literal
2017-11-28 16:03:23 +00:00
Hugo
955526b200
Replace comparison with None with equality operator
2017-11-28 16:03:23 +00:00
Hugo
b69457ccdf
Update to Exception as e, print()
2017-11-28 16:03:23 +00:00
Hugo
2f3c233f38
Simplify Boolean
2017-11-28 16:03:23 +00:00
Hugo
53c1c5dcc1
Remove redundant hasattr checks
2017-11-28 16:03:23 +00:00
Hugo
ffcc65d4f0
Drop support for EOL Python 2.6
2017-11-28 16:02:12 +00:00
Daniele Varrazzo
e7529e4823
Merge remote-tracking branch 'jdufresne/json-docs'
2017-11-28 15:22:09 +00:00
Daniele Varrazzo
f77057dd43
Merge remote-tracking branch 'jdufresne/with-statement'
2017-11-28 15:20:24 +00:00
Jon Dufresne
c1d3948be9
Update documentation to reflect JSON import behavior
...
The docs don't need to describe what will happen on Python versions
before 2.6 as they are unsupported by psycopg2.
Should have been included in commit
d58844e548
, but was missed.
2017-11-28 06:38:44 -08:00
Jon Dufresne
4c95668c72
Remove "from __future__ import with_statement"
...
All versions of Python supported by psycopg2 have builtin support for
the with statement. The import is unnecessary noise.
2017-11-28 06:03:46 -08:00
Daniele Varrazzo
914ccbacb5
Merge branch 'python3_mintimeloggingconnection'
2017-11-28 03:23:42 +00:00
Daniele Varrazzo
b4f066bd43
Mention MinTimeLoggingCursor fix in NEWS file
2017-11-28 03:22:53 +00:00
Daniele Varrazzo
1959d2403f
Merge branch 'solaris-support'
2017-11-28 03:16:04 +00:00
Daniele Varrazzo
a1831ef498
Mention solaris support in NEWS
...
Close #532 .
2017-11-28 03:13:25 +00:00
Daniele Varrazzo
fc8574fdd8
Merge remote-tracking branch 'jdufresne/decimal'
2017-11-28 03:05:06 +00:00
Daniele Varrazzo
06d4788811
Merge remote-tracking branch 'jdufresne/json'
2017-11-28 03:04:59 +00:00
Daniele Varrazzo
e0ce35ef72
Merge remote-tracking branch 'jdufresne/skip-before'
2017-11-28 03:04:44 +00:00
Daniele Varrazzo
db0c081d03
Merge remote-tracking branch 'jdufresne/uuid'
2017-11-28 03:04:26 +00:00
Daniele Varrazzo
a39d794308
Merge remote-tracking branch 'jdufresne/iobase'
2017-11-28 03:04:03 +00:00
Daniele Varrazzo
7855f28785
Merge remote-tracking branch 'jdufresne/namedtuple'
2017-11-28 03:02:56 +00:00
Daniele Varrazzo
dda55dbf36
Moving to next major version on master
...
Opened maintenance branch `maint_2_7`
2017-11-28 03:02:03 +00:00
Daniele Varrazzo
afb42e7625
Merge remote-tracking branch 'jdufresne/py2'
2017-11-28 02:59:17 +00:00
Daniele Varrazzo
b4e658d29b
Merge remote-tracking branch 'jdufresne/license'
2017-11-28 02:39:54 +00:00
Jon Dufresne
296abf735e
Add some missing trove classifiers for general Python support
2017-11-27 07:30:50 -08:00
Jon Dufresne
048f1bb95a
Remove workaround for decimal module
...
The decimal module is available on all Python versions supported by
psycopg2. It has been available since Python 2.4. No need to catch an
ImportError.
https://docs.python.org/2/library/decimal.html
2017-11-26 17:55:24 -08:00
Jon Dufresne
d58844e548
Clean up JSON workarounds for unsupported Python versions
...
All Python versions supported by psycopg2 have the json module. It was
added in Python 2.6. Can remove checks for availability, slightly
simplifying the code.
2017-11-26 17:11:27 -08:00
Jon Dufresne
dfc9932f27
Remove use of skip_before_python for unsupported Python versions
...
psycopg2 does not support Python < 2.6, remove all test guards for these
versions.
2017-11-26 16:43:18 -08:00
Jon Dufresne
582ec189cc
Remove uuid workaround for older Pythons
...
uuid is available on all Python versions supported by psycopg2.
2017-11-26 14:46:53 -08:00
Jon Dufresne
f7d5d25651
Remove io.TextIOBase workaround for Python <= 2.5
...
io.TextIOBase is available on all Python versions supported by psycopg2.
Can remove all workarounds.
2017-11-26 14:32:35 -08:00
Jon Dufresne
05c28cce78
Remove workarounds for namedtuple on Python <= 2.5
...
namedtuple is available on all Python versions supported by psycopg2. It
was first introduced in Python 2.6. Can remove all workarounds and
special documentation.
2017-11-26 13:55:30 -08:00
Jon Dufresne
5ddac80cec
Include license file in the generated wheel package
...
The wheel package format supports including the license file. This is
done using the [metadata] section in the setup.cfg file. For additional
information on this feature, see:
https://wheel.readthedocs.io/en/stable/index.html#including-the-license-in-the-generated-wheel-file
2017-11-26 10:42:30 -08:00
Daniele Varrazzo
858bc3d42a
Merge pull request #616 from jdufresne/modern-exceptions
...
Use modern except syntax throughout project
2017-11-21 11:45:34 +00:00
Jon Dufresne
390e43fcb1
Use modern except syntax throughout project
...
The syntax "except Exception, exc:" is deprecated. All Python versions
supported by psycopg2 support the newer, modern syntax. Forward
compatible with future Python versions.
2017-11-20 20:00:35 -08:00
Daniele Varrazzo
7a2dd85caa
NEWS updated after last bugfix.
2017-11-16 16:07:34 +00:00
Federico Di Gregorio
13b0b9d3e3
Merge pull request #614 from fogzot/fix-613
...
Don't cast point arrays to float arrays (fixes : #613 )
2017-11-16 10:09:28 +01:00
Federico Di Gregorio
5983b96c55
Don't cast point arrays to float arrays ( fixes : #613 )
2017-11-16 10:07:27 +01:00
Daniele Varrazzo
d88d8f9619
Added PostgreSQL 10 in the list of supported servers
2017-11-06 18:38:22 +00:00
Daniele Varrazzo
9614e7241b
Further docs cleanup
...
Recent Sphinx versions seem overly aggressive in autodetecting python,
or I just didn't notice the errors, so be explicit in what language to
use with code examples.
2017-11-06 18:34:23 +00:00
Daniele Varrazzo
4f1505857b
Parameters passing docs improved
...
Every point has an example and all the example show wrong/correct. Nice
rhythm.
Among the improvements, added point saying explicitly "thou shall not
quote placeholders". Quoted placeholders will just fail except in the
most contrived cases (a statement raising an exception with all the
strings except with the attack ones...), and an example in the following
section explicitly notes "no quotes", but apparenty someone still thinks
this is not documented enough? (see issue #611 ) so let's just write it
plain and clear into the list of commandments.
2017-11-06 17:31:35 +00:00
Kevin Campbell
b804c092ac
Patch for issue #609 for MinTimeLoggingConnection
...
On Python3 MinTimeLoggingConnection raises an exception as it tries to
mix strings and bytes
2017-11-03 17:30:06 +08:00
Daniele Varrazzo
dfee199351
Dropped suggestion for --no-binary :all: to skip wheels
...
:all: applies to the entire file. --no-binary psycopg2 is the solution.
See issue #543
2017-10-27 12:34:00 +01:00
My Karlsson
f54783ae6e
Emulate timeradd and timersub on Solaris
...
Solaris does not have timeradd and timersub. Add solaris_support.c which
provides emulated versions of them on Solaris.
2017-10-26 20:21:30 +02:00
Daniele Varrazzo
46d8529dde
Merge branch 'libpq-10-wheels'
2017-10-24 11:52:02 +01:00
Daniele Varrazzo
980145eaee
Preparing release 2.7.3.2
...
Close #601 , close #602 .
2017-10-24 11:43:26 +01:00
Daniele Varrazzo
c6e90766e1
Merge branch 'libpq-10'
...
Fix #604
2017-10-24 11:31:26 +01:00
Daniele Varrazzo
f3f394ced9
Import recipe to build PG 10 libpq on win from wheel repos
...
Also build pg_config so the libpq version is correct at compile time
too.
2017-10-24 11:26:14 +01:00
Daniele Varrazzo
552e49a11d
Test building PG 10 using the solution provided by Jason Erickson
...
https://github.com/psycopg/psycopg2-wheels/pull/3/
2017-10-24 11:26:14 +01:00
Daniele Varrazzo
0d90c173fb
Test against PG 10.0 on Travis
2017-10-24 11:26:14 +01:00
Daniele Varrazzo
f1461d2d7e
Parse PG 10 error codes from final version
2017-10-19 02:28:52 +01:00
Daniele Varrazzo
6ee8b4c9aa
Bumping version to test libpq 10 wheel package
2017-10-18 22:25:42 +01:00
Daniele Varrazzo
582fd95986
Merge branch 'sphinx-1.6'
2017-10-18 21:58:08 +01:00
Daniele Varrazzo
e7587caee3
Dropped doc building warning
...
doctests have sure completely rotten however.
2017-10-18 21:57:17 +01:00
Daniele Varrazzo
4d68f6e414
Sphinx version do build docs updated to 1.6
2017-10-18 21:56:48 +01:00
Dmitry Shachnev
1ccb61fe18
Make dbapi_extension.py compatible with Sphinx 1.6
...
In Sphinx commit 1a821b89e9952fc2, the deprecated make_admonition()
function was removed. This commit updates the code to use the modern
API instead.
2017-10-12 13:10:41 +03:00
Ashesh Vashi
84d405894c
Moving the encrypt_password method from the connection class to the
...
psycopgmodule, and exported it from psycopg2.extensions as per review
comments.
2017-09-14 23:42:54 +05:30
Ashesh Vashi
6e0edf7779
Merge remote-tracking branch 'psycopg2/master'
2017-09-11 18:26:34 +05:30
Daniele Varrazzo
3ec06b88f0
Construct proper human sentences to describe execute_values()
...
With bonus typos dropped.
2017-08-31 16:34:04 +01:00
Daniele Varrazzo
75198a46d4
Merge branch 'fix-wheel-libresolv'
2017-08-25 15:13:36 +01:00
Daniele Varrazzo
c45e219387
Preparing release 2.7.3.1 to fix wheel packages
2017-08-25 15:12:12 +01:00
Daniele Varrazzo
302b2f962f
Bump version number to try fixing libc 2.26 libresolv problem
...
https://github.com/psycopg/psycopg2-wheels/issues/2
[skip-ci]
2017-08-25 12:24:37 +01:00
Daniele Varrazzo
22c7114168
Disable uploading docs on pythonhosted
...
The service is deprecated in favour of RTD. There is also no more way to
upload redirects there, so #581 cannot be fixed.
Official docs are on http://initd.org/psycopg/docs/
2017-08-23 13:42:49 +01:00
Daniele Varrazzo
2c836a2935
Fixed typo (found on stackoverflow... gh)
2017-07-27 12:10:11 +01:00
Daniele Varrazzo
df688d6b87
Bump to next development release
2017-07-24 16:25:16 +01:00
Daniele Varrazzo
cd3393b21c
Bumped version number to 2.7.3
2017-07-24 15:06:09 +01:00
Daniele Varrazzo
9358725963
Merge branch 'fix-578'
2017-07-24 15:04:26 +01:00
Daniele Varrazzo
775de754cf
Added back timestamptz[] default cast
...
It was registered as side effect of an excessive definition that got
cleaned up in 338dbe70a6
.
Looking at other removed redundant type oids, this was the only one
missing from the `string_types` map.
Close #578 .
2017-07-24 14:23:36 +01:00
Daniele Varrazzo
b7bd5eceed
Bump to next development release
2017-07-22 16:13:10 +01:00
Daniele Varrazzo
cfa0509d7e
Deal with E'' strings comparisons in a few other tests
2017-07-22 03:15:06 +01:00
Daniele Varrazzo
d619baf000
Skipped a couple of test with unsupported postgres features
2017-07-22 02:09:24 +01:00
Daniele Varrazzo
791f5fe969
Bump to version 2.7.2
2017-07-22 01:32:25 +01:00
Ashesh Vashi
e089d94c88
'encrypt_password' raises 'psycopg2.NotSupportedErorr' exception for
...
server version >= 10, when compiled using libpq version < 10, when no
algorithm is specified.
2017-07-17 11:46:50 +05:30
Ashesh Vashi
2c1966a7f6
When compiled with libpq version < 10, it raises 'psycopg2.NotSupportedError' (not, psycopg2.ProgrammingError).
2017-07-17 11:06:55 +05:30
Ashesh Vashi
78eb80d0cf
Using 'Text_FromUTF8' macro for transforming the encrypted C string to
...
Python string to make it Python 3 compatible.
2017-07-17 10:54:52 +05:30
Ashesh Vashi
cfb0937605
Added support for preparing the encrypted password of a PostgreSQL
...
password using the libpq functions - 'PQencryptPasswordConn', and
'PQencryptPassword'.
2017-07-17 10:32:59 +05:30
Daniele Varrazzo
d2e86db8fb
Merge branch 'fix-554'
2017-06-17 03:34:01 +01:00
Daniele Varrazzo
1a97445471
Accept Composable in start_replication_expert()
...
Close #554
2017-06-17 03:30:44 +01:00
Daniele Varrazzo
30d89da4fa
Ignore spurious output in test with Python debug build
2017-06-17 03:20:09 +01:00
Daniele Varrazzo
d72efd2fa8
Merge branch 'fix-550'
2017-06-17 01:58:11 +01:00
Daniele Varrazzo
991f0988ee
Use an import style reported not broken on Python 3.6
...
Couldn't reproduce the issue but it has been documented in #550 .
2017-06-17 01:51:37 +01:00
Daniele Varrazzo
8ab16807c6
Merge branch 'fix-558'
2017-06-17 01:38:25 +01:00
Daniele Varrazzo
49ce622a86
Fixed parsing interval from micros on 32 bit
...
Using integers the wrong size. Faithfully segfaulting since 1970.
2017-06-17 01:36:39 +01:00
Daniele Varrazzo
2b5e131831
Merge branch 'fix-558'
2017-06-16 19:41:52 +01:00
Daniele Varrazzo
70a2d2238e
Consider redshift interval supported after further tests
2017-06-16 19:39:18 +01:00
Daniele Varrazzo
324e56cfa3
Merge branch 'fix-562'
2017-06-16 02:32:31 +01:00
Daniele Varrazzo
789eb64f3a
Added Json.prepare()
...
Close #562
2017-06-16 01:37:49 +01:00
Daniele Varrazzo
21ee8b62ef
Merge branch 'mr-566'
2017-06-16 01:04:27 +01:00
Daniele Varrazzo
315f72862c
Parse a number as microseconds when casting interval
...
Should close #558 , but I'm curious to know if a number is returned
for interval < 1 day too (which wouldn't trigger the overflow, but will
finish parsing with part=0).
2017-06-16 00:54:38 +01:00
Sebastian Bank
30af82ef2f
Document that executemany() is not logged with LoggingConnection
2017-06-15 23:27:28 +01:00
Daniele Varrazzo
eef198ac5e
Report issue #541 fixed in the NEWS file
2017-06-15 23:25:19 +01:00
Daniele Varrazzo
8576d43006
Bump version number to test a new build
2017-06-15 23:07:43 +01:00
Daniele Varrazzo
9b4de93bdc
Document incompatibility between wheel package and ssl module
...
Close #543 .
2017-06-15 22:46:53 +01:00
Daniele Varrazzo
338dbe70a6
Dropped wrong associations of PG types to datetime object
...
The wrong associations are overwritten in the typecaster map by the
right ones, so they have been harmless to date, but only because of the
order of creation of the adapters.
2017-06-15 18:24:25 +01:00
Daniele Varrazzo
496cef80c4
Merge branch 'bug-551'
2017-06-15 17:46:04 +01:00
Daniele Varrazzo
7ae2cb5cd0
Don't force a valid return code for the test
...
Windows returns 22, Linux returns 1
2017-06-15 17:39:00 +01:00
Daniele Varrazzo
602c74faa6
Check return code from decoding the connection status
...
It fails on Py3 after receiving a SIGABRT. Because we don't handle it
here it will resurface later with nonsense such as:
SystemError: <some function> returned a result with an error set
Close #551
2017-06-15 17:33:05 +01:00
Daniele Varrazzo
de843ef756
Added test to reproduce bug #551
2017-06-15 17:22:32 +01:00
山楂片
799c5aaf43
typo
...
s/fromat/format/g
2017-06-12 11:25:22 +01:00
Jason Erickson
9ac2b8c3a9
Force rebuild of cache for new OpenSSL/PostgreSQL
...
OpenSSL updated to 1.0.2l
PostgreSQL updated to 9.6.3
2017-06-08 20:11:20 -06:00
Jason Erickson
63cc9ea24b
Build/Test against newer PostgreSQL/OpenSSL
...
Test against PostgreSQL 9.6 and build against newer libraries:
OpenSSL: 1.0.2l
PostgreSQL: 9.6.3
2017-06-08 20:11:17 -06:00
Jason Erickson
c837261ac1
Remove VC9 runtime dependency
...
Changed check in setup.py to only use vc9 manifest when built against
versions that use the MSVC 2008 compiler. Resolves #541 .
Note that as of VS 2010, a manifest is no longer needed according to this
comment, "...we are no longer deploying the VC dlls as Win32 assemblies.
They are regular dlls that can be loaded without a manifest."
https://connect.microsoft.com/VisualStudio/feedback/details/522121/crtassem-h-missing
2017-06-08 20:11:02 -06:00
Daniele Varrazzo
3d13a2cf25
Link the appveyor badge in the readme to the master branch builds
...
[skip-ci]
2017-06-08 20:07:11 +01:00
Daniele Varrazzo
7d9ef5f952
Run tests against PostgreSQL 10 beta1
...
Use the new Postgres verisoning schema: 10 is a major version, 10.0 a
patch release. See
https://wiki.postgresql.org/wiki/New_in_postgres_10#Change_in_Version_Numbering
2017-06-08 18:45:07 +01:00
Daniele Varrazzo
767118467f
Merge branch 'errcodes-update'
2017-06-05 12:49:42 +01:00
Daniele Varrazzo
256910f8ff
Updated docs about versions supported in errcodes
2017-06-05 12:34:17 +01:00
Daniele Varrazzo
89169e6e53
Error codes updated to PG 10 beta 1
2017-06-05 12:34:17 +01:00
Daniele Varrazzo
75d84f0b25
errcodes updated to PG 9.6
2017-06-05 12:18:21 +01:00
Daniele Varrazzo
165449c724
Added doc link to replication commands
2017-05-10 01:55:01 +01:00
Daniele Varrazzo
6e5abf33f2
Merge branch 'fix-547'
2017-04-19 01:34:39 +01:00
Daniele Varrazzo
9d7ff405ee
Added news entries for the previous 2 merge requests
2017-04-19 01:16:08 +01:00
Daniele Varrazzo
a7e3f46431
Merge remote-tracking branch 'fix_lobject_factory'
2017-04-19 01:06:24 +01:00
Daniele Varrazzo
bd34c86aba
Merge remote-tracking branch 'fix_lobject_mode'
2017-04-19 01:06:08 +01:00
Daniele Varrazzo
248e653c9e
Fixed args parsing in ReplicationCursor.consume_stream()
...
Close #547 .
2017-04-19 01:01:59 +01:00
Frazer McLean
9e5621698f
Python < 3.2 doesn’t have assertIsInstance
2017-04-16 03:44:21 +02:00
Frazer McLean
7b3ea43e92
Handle lobject mode=None correctly
2017-04-16 03:20:31 +02:00
Frazer McLean
38cd720369
Fix name of lobject keyword argument
2017-04-16 03:12:18 +02:00
Daniele Varrazzo
4b4d2796b7
Merge branch 'fix-410'
2017-04-05 15:16:01 +01:00
Daniele Varrazzo
cd095ef0ee
Added test to verify callback errors in named cursors
...
They work fine.
2017-04-05 14:54:07 +01:00
Daniele Varrazzo
a66c34a6d0
Don't clobber a Python exception with an unknown error
...
Close #410
2017-04-05 14:54:07 +01:00
Daniele Varrazzo
47f5e97759
Added test to verify #410
...
The 'unknown error' happens on query.
2017-04-05 14:54:07 +01:00
Daniele Varrazzo
3b48918bef
Note that the fast executemany functions don't respect rowcount
...
See issue #540
2017-03-28 10:37:04 +01:00
Daniele Varrazzo
adf55babe8
Merge remote-tracking branch 'origin/fix-536'
2017-03-22 12:19:31 +00:00
Daniele Varrazzo
b94548f5a3
Fix curl not found on AppVeyor
...
http://help.appveyor.com/discussions/problems/6312-curl-command-not-found
2017-03-22 03:54:23 +00:00
Daniele Varrazzo
ee9948fa86
Expose *DATETIMETZ* objects in the extensions module
2017-03-22 03:42:12 +00:00
Daniele Varrazzo
57b1093b31
Find again mxDateTime includes in default locations
2017-03-22 03:36:08 +00:00
Daniele Varrazzo
7214c6652e
Return objects with timezone parsing infinity timestamptz
...
Close #536 .
2017-03-22 03:03:02 +00:00
Daniele Varrazzo
31f91e033f
Dropped info that the features requires libpq >= 9.0
...
We are currently requiring libpq 9.1 at least, and the feature was
released in 2.7, which could have never been compiled with previos
libpq versions.
2017-03-20 19:08:18 +00:00
Daniele Varrazzo
1e0aef032f
Dropped repeated doc links in the same paragraph
...
And some more sql docs cleanup.
2017-03-16 04:40:22 +00:00
Daniele Varrazzo
f9b36433fb
Merge branch 'fix-528'
2017-03-16 04:24:17 +00:00
Daniele Varrazzo
ba0329fb40
replication connection init refactored to use psyco_make_dsn
...
Some extra bonus refactoring to improve the function readability (don't
reuse names for variables with different refcount rules, don't pass
separate obj/self, async pass-through...)
2017-03-16 03:55:22 +00:00
Daniele Varrazzo
9f160fd820
Obscure the password on url dsn too
...
Note that we don't leak anymore the password length.
Fix #528
2017-03-16 03:53:40 +00:00
Daniele Varrazzo
c7f5690426
Added docs about the usability of sql objects with copy_expert()
...
See issue #529 .
2017-03-16 00:55:20 +00:00
Daniele Varrazzo
3bfbd3a0a5
Added test to verify sql objects work with copy_expert()
...
I'll be honest: I lucked out, I didn't think about this combination. But
maybe sheer luck, maybe using common code paths, it just works. Let's
make it stays so.
2017-03-16 00:55:20 +00:00
Daniele Varrazzo
103655d670
Password scrubbing refactored in a separate function
2017-03-15 16:04:45 +00:00
Daniele Varrazzo
cc047a445a
Added tests to verify the password is obscured
...
The url test fails: see issue #528
2017-03-15 16:00:40 +00:00
Daniele Varrazzo
7187d6408a
Merge branch 'fix-443'
2017-03-14 14:41:48 +00:00
Daniele Varrazzo
3626e961f8
Reported bug #443 fixed *again*
...
Also see ticket #527 .
2017-03-14 14:16:02 +00:00
Daniele Varrazzo
8e28444897
Bunch of test tweaks to make the test grid green
2017-03-14 14:15:52 +00:00
Daniele Varrazzo
7c2333dd81
Connection state fixed noted in the news
2017-03-14 14:15:52 +00:00
Greg Ward
12317557da
Always raise OperationalError when connection was closed externally.
...
From the DB-API (https://www.python.org/dev/peps/pep-0249/ ):
OperationalError
Exception raised for errors that are related to the database's
operation and not necessarily under the control of the programmer,
e.g. an unexpected disconnect occurs, [...]
Additionally, psycopg2 was inconsistent, at least in the async case:
depending on how the "connection closed" error was reported from the
kernel to libpq, it would sometimes raise OperationalError and
sometimes DatabaseError. Now it always raises OperationalError.
2017-03-14 12:14:00 +00:00
Greg Ward
b203a7c775
Always detect when a connection is closed behind psycopg2's back.
...
There's a race condition that only seems to happen over Unix-domain
sockets. Sometimes, the closed socket is reported by the kernel to
libpq like this (captured with strace):
sendto(3, "Q\0\0\0\34select pg_backend_pid()\0", 29, MSG_NOSIGNAL, NULL, 0) = 29
recvfrom(3, "E\0\0\0mSFATAL\0C57P01\0Mterminating "..., 16384, 0, NULL, NULL) = 110
recvfrom(3, 0x12d0330, 16384, 0, 0, 0) = -1 ECONNRESET (Connection reset by peer)
That is, psycopg2/libpq sees no error when sending the first query
after the connection is closed, but gets an error reading the result.
In that case, everything worked fine.
But sometimes, the error manifests like this:
sendto(3, "Q\0\0\0\34select pg_backend_pid()\0", 29, MSG_NOSIGNAL, NULL, 0) = -1 EPIPE (Broken pipe)
recvfrom(3, "E\0\0\0mSFATAL\0C57P01\0Mterminating "..., 16384, 0, NULL, NULL) = 110
recvfrom(3, "", 16274, 0, NULL, NULL) = 0
recvfrom(3, "", 16274, 0, NULL, NULL) = 0
i.e. libpq received an error when sending the query. This manifests as
a slightly different exception from a slightly different place. More
importantly, in this case connection.closed is left at 0 rather than
being set to 2, and that is the bug I'm fixing here.
Note that we see almost identical behaviour for sync and async
connections, and the fixes are the same. So I added extremely similar
test cases.
Finally, there is still a bug here: for async connections, we
sometimes raise DatabaseError (incorrect) and sometimes raise
OperationalError (correct). Will fix that next.
2017-03-14 12:08:03 +00:00
Daniele Varrazzo
3c124a0b87
Flake8 complaints
2017-03-14 12:06:46 +00:00
Daniele Varrazzo
ef9f9f5fff
Improved notes to release psycopg packages
2017-03-13 16:50:57 +00:00
Daniele Varrazzo
5730aa9a40
Less stuff in the readme, more in the docs
2017-03-13 12:13:47 +00:00
Daniele Varrazzo
8ed0196d02
Bump to next dev release
2017-03-13 11:50:34 +00:00
Daniele Varrazzo
09c48c76c3
Bump to version 2.7.1
2017-03-11 17:03:22 +00:00
Daniele Varrazzo
b075c7169c
Report ticket 518 fixed
...
The fix is actually implemented in the openssl1 branch of
https://github.com/psycopg/psycopg2-wheels
2017-03-11 17:00:58 +00:00
Jon Nelson
c661695b28
correct minor grammatical issue with deprecation warning
2017-03-03 13:54:22 +00:00
Daniele Varrazzo
06fbd0ee02
Dropped "what's new in 2.7.1" from docs index
2017-03-03 13:50:57 +00:00
Daniele Varrazzo
e3f56718d2
Added install section to specify how to skip wheels
2017-03-03 13:49:19 +00:00
Daniele Varrazzo
d007dc3249
Merge branch 'fix-520'
2017-03-02 19:36:45 +00:00
Daniele Varrazzo
a5382d7b72
Skip the tests according to the earliest of libpq built/linked.
2017-03-02 19:32:44 +00:00
Daniele Varrazzo
26bd5df048
Don't use PG_INT64_TYPE
...
Only defined in Postgres 9.3
Should close #520 , but let's wait for the CI response (build on
Windows etc.)
2017-03-02 19:32:39 +00:00
Daniele Varrazzo
3a441467c0
Merge branch 'no-unittest2'
...
Close #516
2017-03-02 12:41:33 +00:00
Daniele Varrazzo
6be94f1927
Merge branch 'fix-517'
2017-03-02 12:22:27 +00:00
Daniele Varrazzo
5a65ff5cf4
Don't try to use unittest2
...
Modules importing unittest directly would miss the monkeypatch: see
ticket #516 .
2017-03-01 20:44:04 +00:00
Daniele Varrazzo
44d8edfd8c
Ignore None arguments passed to make_dsn()
...
Close #517 .
2017-03-01 20:12:13 +00:00
Daniele Varrazzo
455f51c36c
Added docs about making a release
...
Drop previous script which didn't include the CI-generated packages.
[skip ci]
2017-03-01 15:59:15 +00:00
Daniele Varrazzo
6f7e570a0a
Bump away from 2.7
...
[skip ci]
2017-03-01 15:56:54 +00:00
Daniele Varrazzo
51591e2c23
Merge branch 'fix-512'
2017-03-01 02:14:40 +00:00
Daniele Varrazzo
3638d349ba
Skip test on PG version with bad interval rounding
...
On these ancient versions:
=# select '999999:00:00.1'::interval;
interval
--------------------------------
41666 days 15:00:00.0999999046
2017-03-01 02:14:35 +00:00
Daniele Varrazzo
b0e6045b63
Bump to version 2.7
...
Refer to pep 440 for version numbering, which superseded pep 386. We are
not changing numbering scheme: the version numbers we have used (when we
have been consistent) would have been valid in both schemes.
2017-02-28 11:57:08 +00:00
Daniele Varrazzo
a2bc3c7bcb
Fixed doc typo
...
Close #515
2017-02-28 11:28:11 +00:00
Daniele Varrazzo
c871c49f55
Dropped reference to "isolation level autocommit" in docs
2017-02-24 16:53:32 +00:00
Daniele Varrazzo
72f74d1f41
Dropped compiler warning on Windows
2017-02-24 13:33:42 +00:00
Daniele Varrazzo
451e1e2e73
Merge branch 'fix-512'
2017-02-24 13:33:36 +00:00
Daniele Varrazzo
691df4952b
Handle overflow in interval parsing
2017-02-24 13:23:56 +00:00
Daniele Varrazzo
3b665d35d5
Make sure to use 64 bits in interval parsing accumulators
2017-02-24 12:10:54 +00:00
Daniele Varrazzo
834e9996da
Parse interval only using integers
...
(almost... except for micros rounding)
While this is probably an improvement on the previous implementation,
I am largely waving a dead chicken at windows, which keeps failing to
pass the seconds overflow test. If it doesn't pass now either I'll start
blaming Python's timedelta.
2017-02-24 03:48:41 +01:00
Daniele Varrazzo
e351606b69
Display Appveyor build status of master branch
2017-02-24 02:49:45 +01:00
Daniele Varrazzo
a15dfbbd4f
Try to fix the same problem in windows
...
Previous commit doesn't pass on Windows: it looks like window's floor()
has an integer overflow.
2017-02-24 02:41:34 +01:00
Daniele Varrazzo
14fe3ad8c9
Fixed integer overflow in interval typecaster
...
Close #512 .
2017-02-24 02:10:27 +01:00
Daniele Varrazzo
f5bd6063fc
Fixed link to attribute in news
2017-02-16 20:25:58 +00:00
Daniele Varrazzo
a3193aca2a
Bump version number
2017-02-16 20:25:58 +00:00
Daniele Varrazzo
355d62f084
Url to download VC fix file moved to this repos
2017-02-16 18:31:49 +00:00
Daniele Varrazzo
1cb2721a67
Bumping to 2.7 beta 2
2017-02-16 18:26:37 +00:00
Daniele Varrazzo
559dbe7b53
Merge branch 'test-windows'
2017-02-16 18:23:23 +00:00
Daniele Varrazzo
30efe59af7
Document installation from wheel packages
2017-02-16 18:22:41 +00:00
Daniele Varrazzo
afcae0a61b
Download external packages in .zip instead of .tar.gz
...
7z barfs every now and then with tar files
(https://ci.appveyor.com/project/psycopg/psycopg2/build/job/oh1ux3ih7baia0uu )
2017-02-16 17:35:16 +00:00
Daniele Varrazzo
089ceb96a8
Download postgres from github instead of ftp.postgresql.org
...
There may be some misconfigured mirror, download fails randomly, e.g.
https://ci.appveyor.com/project/psycopg/psycopg2/build/job/9j792s03tghrb7sr
2017-02-16 16:32:17 +00:00
Daniele Varrazzo
7819d0fc6c
Windows testing tweaks, badge on README
2017-02-16 16:16:16 +00:00
Daniele Varrazzo
535ff672c0
Added AppVeyor configuration to test building on Windows
2017-02-16 15:43:11 +00:00
Daniele Varrazzo
82adf8a162
Merge branch 'session-attributes'
2017-02-16 14:50:21 +00:00
Daniele Varrazzo
61101888e4
Revert default_transaction_* to default only if set
...
When moving from autocommit True -> False reset only the server
parameters that were actually specified by psycopg to honour the
serssion characteristics.
2017-02-16 13:15:14 +00:00
Daniele Varrazzo
d7bba865f3
Check for deferrable unsupported applied to attribute too
2017-02-16 13:14:45 +00:00
Daniele Varrazzo
d50ed48807
Added readonly and deferrable attributes
2017-02-16 12:46:35 +00:00
Daniele Varrazzo
b5d80b609d
Revert pre-2.7b1 behaviour of silent rollback on conn.set_isolation_level()
...
Legacy method is legacy.
2017-02-16 12:46:35 +00:00
Daniele Varrazzo
20c9c17457
connection.isolation_level is now writable
2017-02-16 12:46:35 +00:00
Daniele Varrazzo
fb1a47c064
Link COPY from docs index to our docs instead of postgres ones
2017-02-16 12:46:12 +00:00
Daniele Varrazzo
6c79f936bd
SQL links not bold in the docs
...
Consistent with the SQL representation not linked.
2017-02-16 12:38:04 +00:00
Daniele Varrazzo
75747606d3
Merge branch 'pull-507'
2017-02-11 20:34:37 +00:00
Jason Erickson
32e81a27b5
Allowed inittype.h's defs all versions of MSVC
...
Apparently only MSVC 2015 x64 had defined these types. Changed check to
work for all versions of MSVC. Does not affect 2015x64.
2017-02-10 10:14:17 -07:00
Jason Erickson
7493ea24f2
Defined inttypes.h for older MSVC compilers
...
Older MSVC compilers do not support the C99 standard
2017-02-09 22:27:18 -07:00
Jason Erickson
d52e9100d2
Added support for MSVC compiler
...
Added function 'timeradd'.
Changed second parameter of 'gettimeofday' to void since not used in
function and MSVC timezone definition is not a struct).
2017-02-09 20:57:54 -07:00
Jason Erickson
83cf908c88
Fixed MSVC compiler error and warning
...
MSVC doesn't like referencing new initialized variables in the variable
declaration section.
2017-02-09 20:54:29 -07:00
Daniele Varrazzo
ee4887b4c5
Download testing servers from upload instead of tarballs
2017-02-08 18:37:40 +00:00
Daniele Varrazzo
4b78ca4405
Fixed generation of download url from beta version
2017-02-08 18:09:15 +00:00
Daniele Varrazzo
21fbe2bd2a
Fixed argument name in executemany docs
2017-02-08 14:01:57 +00:00
Daniele Varrazzo
b4b8b5f164
Bump version number
2017-02-08 13:56:50 +00:00
Daniele Varrazzo
6f83c9c87a
Bump version to 2.7 beta 1
2017-02-08 10:31:27 +00:00
Daniele Varrazzo
d2cafe2684
Dropped references to prepare in cur.execute[many] docs
...
They were copied from the DBAPI spec but that's not how psycopg works.
2017-02-08 10:31:19 +00:00
Daniele Varrazzo
d2cd1236a8
Dropped compiler warning about signed/unsigned comparisons
2017-02-08 08:44:08 +00:00
Daniele Varrazzo
3e12522bc9
Don't convert '{}'::unknown into an empty list
...
Close #506 .
2017-02-08 08:43:53 +00:00
Daniele Varrazzo
791befca18
Use pydll to poke into extension library
...
Causes an error in Py 3.6 in debug mode.
Close #505
2017-02-07 12:29:06 +00:00
Daniele Varrazzo
7210287e76
Stop a docstring generating a warning
...
Valid reST, slightly less valid Python.
2017-02-07 12:29:05 +00:00
Daniele Varrazzo
28c489f17e
Merge branch 'no-set-default-session'
2017-02-07 00:58:54 +00:00
Daniele Varrazzo
3ff350cd24
Merge branch 'test-dinosaurs'
2017-02-07 00:58:48 +00:00
Daniele Varrazzo
7485fabe4f
Fixed BEGIN; SET TRANSACTION with PG 7.4
2017-02-07 00:58:29 +00:00
Daniele Varrazzo
705dda2cba
Dropped support for Python 3.1
2017-02-06 23:03:48 +00:00
Daniele Varrazzo
7b11b95908
Skipped a couple of tests failing on old dbs
...
I don't even know why - worth investigating.
2017-02-06 21:40:05 +00:00
Daniele Varrazzo
7f593d5eb0
Skip tests with server not supporting NULL in array
2017-02-06 21:40:05 +00:00
Daniele Varrazzo
2e18b42db0
Don't test with server not implementing INSERT with VALUES list
2017-02-06 21:40:05 +00:00
Daniele Varrazzo
3873c6c09f
Deal consistently with E'' quotes in tests
2017-02-06 21:40:05 +00:00
Daniele Varrazzo
d23fe42873
Work around a race condition in async cancel test
2017-02-06 21:40:05 +00:00
Daniele Varrazzo
e599da6308
assertDsnEqual moved as TestSuite method
2017-02-06 21:40:05 +00:00
Daniele Varrazzo
f5cad47909
Run the test suite with postgres versions not available on travis
2017-02-06 21:40:05 +00:00
Daniele Varrazzo
e9c5f66450
build-manylinux script moved to build-wheels project
2017-02-06 19:12:17 +00:00
Daniele Varrazzo
9f467231d9
Merge branch 'conform-subclass-adapter'
2017-02-05 12:13:52 +01:00
Daniele Varrazzo
c6af16c3ae
Slower timeout for a test that sometimes fail
...
At least it should fail with an error after 2 seconds, not waiting for
Travis timeout of 10 minutes.
2017-02-05 12:06:55 +01:00
Daniele Varrazzo
30a833f57a
Dropped compiler warning in debug mode
2017-02-05 12:06:55 +01:00
Daniele Varrazzo
3fbff5d848
Give precedence to '__conform__()' over superclasses choosing adapter
...
Close #456
2017-02-05 11:54:50 +01:00
Daniele Varrazzo
c54a614c6e
Added documentation about the changes in transaction control
2017-02-04 15:55:59 +00:00
Daniele Varrazzo
9054eeccc0
Set default_transaction_* GUC if session state is changed in autocomit
2017-02-04 15:19:41 +00:00
Daniele Varrazzo
665e9dc665
Exposing ISOLATION_LEVEL_DEFAULT to Python
...
This is now the state that is returned to Python if nothing has been
explicitly set.
2017-02-04 14:43:54 +00:00
Federico Di Gregorio
9448576ba6
Merge pull request #504 from fogzot/pgversion-fix
...
Fixed version regexp to match "10devel"
2017-02-04 14:32:06 +01:00
Daniele Varrazzo
c60682c230
Reuse set_session to implement autocommit, set_isolation_level
2017-02-04 13:26:43 +00:00
Federico Di Gregorio
8b96bcddff
Fixed version regexp to match "10devel"
...
Also normalized the result and made sure that if PostgreSQL ever starts
using just integer version numbers (as in "10") everything still works.
2017-02-04 14:21:07 +01:00
Daniele Varrazzo
8527144173
Better separation between interface and state change code
...
The state change function has a C callable signature.
2017-02-04 13:01:11 +00:00
Daniele Varrazzo
ca59fd8b3f
Test looking the transactions characteristics instead of the default
...
So we test the effect, not the implementation. Tests pass on master too
this way, three tests fail in this branch, related to autocommit
(sort-of-obviously).
2017-02-04 10:57:30 +00:00
Daniele Varrazzo
c1e016e597
Don't use default_transaction_* for session characteristics
...
Store the state in the connection object and set the params on BEGIN
Some tests fail: a few can be fixed reading transaction_* instead of
default_transaction_*; but the behaviour of tx characteristics with
autocommit is effectively changed. It may be addressed by setting
default_transaction_* if autocommit is set.
2017-02-04 02:38:56 +00:00
Daniele Varrazzo
9863637f30
Dropped compiler warning in debug mode
2017-02-04 02:32:26 +00:00
Daniele Varrazzo
de8b335d80
Merge branch 'master' into sql-compose
2017-02-03 04:56:02 +00:00
Daniele Varrazzo
ca42306d79
Misplaced NEWS entry fixed.
2017-02-03 04:52:49 +00:00
Daniele Varrazzo
1911b250e3
Merge branch 'async-keyword'
...
Close #495
2017-02-03 04:45:17 +00:00
Daniele Varrazzo
44c3b77691
Added docs for async_ alias
2017-02-03 04:43:49 +00:00
Daniele Varrazzo
ce9be69615
Added async_ as an alias for async
...
Added in argument for psycopg2.connect() and connection.__init__, and
for the connection.async attribute.
2017-02-03 04:43:49 +00:00
Daniele Varrazzo
8baf6aa372
Convert warnings into errors on test
2017-02-03 04:41:32 +00:00
Daniele Varrazzo
6e89db020c
Merge branch 'fast-executemany'
2017-02-03 04:40:34 +00:00
Daniele Varrazzo
95226baa9b
Further minimal performance tweaks to execute_values
2017-02-02 17:44:25 +00:00
Daniele Varrazzo
dc1b4fff90
Avoid an useless encode/decode roundtrip in execute_values()
...
Tests moved into a separate module.
2017-02-02 17:29:17 +00:00
Daniele Varrazzo
d2fdc5ca9f
Better docs for fast executemany functions.
...
Issue #502 .
2017-02-02 16:02:33 +00:00
Daniele Varrazzo
d8b1fbd905
Further skipping of slow tests
2017-02-02 03:02:29 +00:00
Daniele Varrazzo
626e57acda
Merge branch 'fast-executemany'
2017-02-02 02:40:28 +00:00
Daniele Varrazzo
27652ed3b0
Added notes about using execute_batch with prepared statements
2017-02-02 02:40:03 +00:00
Daniele Varrazzo
ad6506ff69
Merge branch 'manylinux'
2017-02-02 02:15:15 +00:00
Daniele Varrazzo
88a21689ce
Added note about finding slow tests
2017-02-02 02:09:59 +00:00
Daniele Varrazzo
f24de0357f
Allow skipping the slow test
...
It's not so much about tests being slow: some just get stuck and timeout
travis.
Skipped all tests taking about more than 0.2s to run on my laptop.
Fast testing takes about 8s instead of 24.
2017-02-02 01:53:50 +00:00
Daniele Varrazzo
9ca51e0ed9
Use the server on the host to test
2017-02-01 17:33:12 +00:00
Daniele Varrazzo
815869375b
Merge back manylinux build script from the psycopg2-wheels project
2017-02-01 17:05:47 +00:00
Daniele Varrazzo
9bac37baf7
Fixed execute_values with unicode
...
Also added unicode tests.
2017-02-01 02:47:59 +00:00
Daniele Varrazzo
2e2dcd536b
Fixed fast execute functions with Python 3
2017-02-01 02:36:54 +00:00
Daniele Varrazzo
26952ecee4
Fixed sql docs style with newer Docutils versions
2017-02-01 02:00:20 +00:00
Daniele Varrazzo
a95fd3df1a
Added execute_batch and execute_values functions
2017-02-01 01:59:47 +00:00
Daniele Varrazzo
8ac839ce95
Merge branch 'fix-iter-warning'
2017-01-05 15:27:26 +00:00
NotSqrt
9ffb61214c
Fix DeprecationWarning: generator '__iter__' raised StopIteration
...
Closes #498
2017-01-04 09:45:53 +01:00
Daniele Varrazzo
8341792c5b
Added script to create manylinux1 wheels
...
See issue #425
2017-01-04 04:43:54 +01:00
Daniele Varrazzo
651f1b6c97
Consider Python 3.6 and Postgres 9.6 supported
2017-01-03 19:12:44 +01:00
Daniele Varrazzo
a8a3a298f8
Autonumbered args not available in Python 2.6
2017-01-03 17:53:02 +01:00
Daniele Varrazzo
71a168797c
Several improvements to the sql objects
...
Comparable, iterable, content accessible
2017-01-03 17:27:01 +01:00
Daniele Varrazzo
a76e665567
Use {} instead of %s placeholders in SQL composition
2017-01-03 15:02:34 +01:00
Daniele Varrazzo
49461c2c39
More doc love for the sql module
2017-01-01 18:15:01 +01:00
Daniele Varrazzo
9926942260
Added missing doc file
2017-01-01 16:01:55 +01:00
Daniele Varrazzo
077328c1a2
Using the new name of the old doc template
2017-01-01 16:01:09 +01:00
Daniele Varrazzo
d97399daa5
sql module docs wordsmithing
2017-01-01 09:23:26 +01:00
Daniele Varrazzo
cf40bff2e2
Dropped sql.compose
...
Use a SQL % operator instead.
2017-01-01 08:39:02 +01:00
Daniele Varrazzo
4a55b8018a
Adding sql module documentation
2017-01-01 08:12:05 +01:00
Daniele Varrazzo
41b9bfe401
Added test for sql percents treatment
2017-01-01 06:37:09 +01:00
Daniele Varrazzo
828415d476
Typo: composible -> composable
2017-01-01 06:32:18 +01:00
Daniele Varrazzo
ad2643266f
Fixed sql.compose with no args and added tests
2017-01-01 06:26:54 +01:00
Daniele Varrazzo
8c020ca47a
Fixed sql.Composed representation
2017-01-01 06:26:42 +01:00
Daniele Varrazzo
600416aafc
Fixed sql stuff in Py3
2017-01-01 05:59:21 +01:00
Daniele Varrazzo
c4a67fc1c1
Added sql.compose() implementation
2017-01-01 05:23:42 +01:00
Daniele Varrazzo
f11e6d82b0
Added basic sql module implementation
2017-01-01 05:23:15 +01:00
Daniele Varrazzo
fad5100079
Adding some boilerplate for the new module
2017-01-01 03:53:08 +01:00
Daniele Varrazzo
21f38a4c07
Don't try to write bytes in the LoggingConnection file
...
Close #483
2016-12-29 22:42:25 +01:00
Daniele Varrazzo
449bd4485f
Merge branch 'fast-codecs'
2016-12-29 22:15:46 +01:00
Daniele Varrazzo
f3e47a72ed
Brag about encoding/decoding speedup
2016-12-29 22:11:58 +01:00
Daniele Varrazzo
cb5293be1f
Use the proper API functions to look up codec functions
2016-12-29 22:11:58 +01:00
Daniele Varrazzo
3295beb777
Don't look up for Python encoding
...
Store the encode/decode functions for the right codec in the connection.
The Python encoding name has been dropped of the connection to avoid the
temptation to use it...
2016-12-29 22:11:58 +01:00
Daniele Varrazzo
a81f12f9bd
Don't set tp_compare on Python 3
...
The slot is unused in Py < 3.5, and replaced by pg_as_async in Py 3.5.
2016-12-29 21:43:04 +01:00
Daniele Varrazzo
dfe547856e
Use -1 instead of 0 to say "calculate the length" in many funcs
...
0 is a valid length, isn't it?
2016-12-27 00:29:01 +01:00
Daniele Varrazzo
a255e4e1c6
Store python encoding and decoding functions in the connection
...
Unused for now: will be used instead of 'pyenc', which is to be dropped.
2016-12-27 00:29:01 +01:00
Daniele Varrazzo
17a74cc771
Setting connection encoding refactored
...
Code paths to read encoding on connection and to store the new
connection in the structure after changing it in the backend unified
into a single function.
2016-12-26 16:51:22 +01:00
Daniele Varrazzo
f439ca61d6
conn->codec rename to pyenc
2016-12-26 12:25:13 +01:00
Daniele Varrazzo
7caba160b7
Merge branch 'master' into fast-codecs
2016-12-26 12:06:21 +01:00
Daniele Varrazzo
e9577e9b89
Merge branch 'named-callproc'
2016-12-26 04:57:07 +01:00
Daniele Varrazzo
c46b6ea719
Fixed travis test: unset green mode
2016-12-26 04:31:18 +01:00
Daniele Varrazzo
64342fcff0
Less verbose travis tests
2016-12-26 04:13:41 +01:00
Daniele Varrazzo
ffeb7001eb
Fixed refcount problems in named callproc
2016-12-26 04:12:18 +01:00
Daniele Varrazzo
d13521a6ce
Mention named callproc in news, fixed docs.
2016-12-26 03:39:28 +01:00
Daniele Varrazzo
1957389bea
Merge branch 'master' into named-callproc
2016-12-26 03:19:02 +01:00
Daniele Varrazzo
a53b39efe8
Dropped internal escape identifier function
...
Using libpq one as now it's guaranteed to be present.
2016-12-26 03:11:36 +01:00
Daniele Varrazzo
faaef61c27
Merge branch 'master' into named-callproc
2016-12-26 01:49:42 +01:00
Daniele Varrazzo
17698c4815
Fixed REst error in newsfile
2016-12-25 21:17:24 +01:00
Daniele Varrazzo
4c99cadabe
Fixed intersphinx links to Pyton docs
2016-12-25 21:17:14 +01:00
Luke Nezda
dcb198e8b7
fix wait_select sample to be extras
not extensions
2016-12-25 20:49:24 +01:00
Tim Graham
35b4a01b6d
Fix "invalid escape sequence" warning in Python 3.6
...
http://bugs.python.org/issue27364
2016-12-25 20:43:29 +01:00
Daniele Varrazzo
1c3e2be224
Merge branch 'fix-453'
2016-12-25 19:56:40 +01:00
Daniele Varrazzo
d48d4bab05
Added empty options in setup.cfg
...
Setuptools removes them from the sdist, see #453
2016-12-25 19:46:09 +01:00
Daniele Varrazzo
c9798ecb15
Merge branch 'dont_set_datestyle_in_replication_mode'
2016-12-25 19:28:23 +01:00
Daniele Varrazzo
c22093ddd4
Skip replication tests in green mode
2016-12-25 19:00:30 +01:00
Daniele Varrazzo
874705db42
Configure Travis to test replication
2016-12-25 18:37:26 +01:00
Daniele Varrazzo
b73115ac41
Added test to verify bug #482
2016-12-25 18:30:27 +01:00
Daniele Varrazzo
e27579292a
Avoid deadlock on close if set datestyle failed
2016-12-25 17:45:01 +01:00
Daniele Varrazzo
c2d405116b
Dropped testing print
2016-12-25 17:44:25 +01:00
Daniele Varrazzo
b77de74f72
Merge branch 'master' into dont_set_datestyle_in_replication_mode
2016-12-25 16:31:33 +01:00
Daniele Varrazzo
f451d35aae
Merge branch 'travis'
2016-12-24 04:51:30 +01:00
Daniele Varrazzo
feebc8f689
Don't use separate databases for tests
...
I got this wrong: I thought parallel test ran in the same VM; they are
isolated instead.
2016-12-24 04:42:55 +01:00
Daniele Varrazzo
1463bdb86d
Added build badge to readme
2016-12-24 04:28:34 +01:00
Daniele Varrazzo
6758ce5eef
Test Python versions in a more relevant order
2016-12-24 04:27:51 +01:00
Daniele Varrazzo
def22982fb
Run the tests against all the available server versions
2016-12-24 04:12:03 +01:00
Daniele Varrazzo
11ad1005e0
Added python3 supported versions
2016-12-24 01:09:57 +01:00
Daniele Varrazzo
a478ba9a47
Fixed tests failing on Python 2.6
2016-12-24 01:03:57 +01:00
Daniele Varrazzo
b3cd125d27
Create the hstore extension in the trevis db
2016-12-24 00:18:09 +01:00
Daniele Varrazzo
0be783c454
Disable email notification
...
Mmm... it seems it's going to be a long night...
2016-12-24 00:12:32 +01:00
Daniele Varrazzo
3971ee6d1f
Testing CI with Travis
2016-12-24 00:07:23 +01:00
Christoph Moench-Tegeder
fb1dbc2a9b
do not "SET datestyle" on replication connections
...
A replication connection - marked by the use of the keyword "replication"
in the DSN - does not support SET commands. Trying to sent "SET datestyle"
will result in an exception.
2016-10-21 15:32:11 +02:00
Daniele Varrazzo
121cf3b8f8
Optimize UTF8 and Latin1 decoding
...
Cache a pointer to a fast decoding function when the connection encoding
is set so skip a repeated codec lookup for every string.
2016-10-12 01:10:31 +01:00
Daniele Varrazzo
584c7e6890
Dropped compiler warning in debug mode
2016-10-12 00:28:25 +01:00
Daniele Varrazzo
51aa166d52
Merge branch 'networking-improvement'
2016-10-11 04:55:09 +01:00
Daniele Varrazzo
643ba70bad
Added ipaddress objects conversion
...
Close #387
2016-10-11 04:54:41 +01:00
Daniele Varrazzo
706ad2f177
Conver network array types into array of strings by default
2016-10-11 02:31:45 +01:00
Daniele Varrazzo
86198c1c21
inet adapters deprecated
...
Close #343
2016-10-11 02:17:56 +01:00
Daniele Varrazzo
05627ac0f9
Fix unicode mogrify test on python 2
2016-10-11 00:22:23 +01:00
Daniele Varrazzo
91d2158de7
Python source cleanup using flake8
2016-10-11 00:11:55 +01:00
Daniele Varrazzo
4458c9b4c9
Merge branch 'drop-libpq-pre-91'
2016-08-15 02:58:36 +01:00
Daniele Varrazzo
b3792c7f02
Mention dropping Pre 9.1 libpq support in NEWS file
2016-08-15 02:57:49 +01:00
Daniele Varrazzo
5ddc952dbb
Dropped ifdef guards against obsolete libpq versions
...
One of them was actually wrong: lobject_type.c wouldn't have compiled
pre 8.3 (broken in 6e841a41
, 2 years ago).
2016-08-15 02:55:44 +01:00
Daniele Varrazzo
3d4f6df0de
Enforce dependency on libpq version >= 9.1
...
PGRES_COPY_BOTH was introduced in 9.1: we can ifdef the hell out of
pgpath, but we may as well bury the dead horses instead of beating
them.
They smell funny, too.
2016-08-15 02:55:43 +01:00
Daniele Varrazzo
b006190312
Merge branch 'drop-py25'
2016-08-15 02:51:10 +01:00
Daniele Varrazzo
47a312cf83
Mention dropping Py 2.5 support in NEWS file
2016-08-15 02:39:26 +01:00
Daniele Varrazzo
78649f8e90
Dropped use of b() "macro" and 2to3 fixer
...
Just use the b"" strings syntax supported from python 2.6.
2016-08-15 01:56:36 +01:00
Daniele Varrazzo
3b41c3a6f3
Stop compiling with Python 2.5
2016-08-15 01:06:42 +01:00
Daniele Varrazzo
1d950748af
Merge branch 'replication-protocol'
2016-08-14 21:09:54 +01:00
Daniele Varrazzo
01c552baa3
Mention replication support in the NEWS file
2016-08-14 21:09:00 +01:00
Daniele Varrazzo
e0883f1967
Name the db in the replication test like the unit test one
2016-08-14 19:57:29 +01:00
Daniele Varrazzo
e5390fed98
Use inttypes.h definitions
2016-08-14 19:48:31 +01:00
Daniele Varrazzo
12ecb4b2ce
Dropped import of postgres internal/c.h
...
Stops warning (caused by command line definition of PG_VERSION, so it
could have been avoided otherwise), but the file comment says:
Note that the definitions here are not intended to be exposed to clients
of the frontend interface libraries --- so we don't worry much about
polluting the namespace with lots of stuff...
so it doesn't seem a good idea gulping it.
2016-08-14 19:36:48 +01:00
Daniele Varrazzo
e779fec5f9
Merge branch 'nul-terminator'
2016-08-07 02:51:27 +01:00
Daniele Varrazzo
478f43f0c8
Mention NULL characters guard in NEWS file
...
Fix #420 .
2016-08-07 02:51:06 +01:00
Daniele Varrazzo
bd95269c69
Merge branch 'master' into nul-terminator
2016-08-07 02:49:13 +01:00
SpootDev
edd51aac25
spelling fix
2016-08-07 02:44:08 +01:00
Daniele Varrazzo
ab671146de
Merge branch 'range-picklable'
2016-08-07 02:40:05 +01:00
Daniele Varrazzo
ec1e578e4b
Report range picklable in NEWS file
...
Fix #462
Conflicts:
NEWS
2016-08-07 02:39:26 +01:00
Jonathan Ross Rogers
cde19c4d59
Make Range pickleable
2016-08-07 02:38:52 +01:00
Daniele Varrazzo
86434548a7
Replication docs massaging, mostly formatting
2016-08-07 02:23:02 +01:00
Daniele Varrazzo
9a4f8f915f
Reshuffling and indexing of replication docs
2016-08-07 02:07:16 +01:00
Daniele Varrazzo
2a4d6027a4
Merge branch 'master' into replication-protocol
...
Conflicts:
tests/testconfig.py
2016-08-07 01:53:21 +01:00
Alexander Schrijver
03824a1dba
Throw an exception when a NUL character is used as a parameter.
2016-07-18 22:56:55 +02:00
Daniele Varrazzo
90ee1ebba5
errorcodes map updated to PostgreSQL 9.5.
2016-07-01 20:14:30 +01:00
Daniele Varrazzo
7566af145b
Merge branch 'conn-get-parameters'
2016-07-01 20:12:01 +01:00
Daniele Varrazzo
00de4052d1
Mention get_dsn_parameters() in news, improved docs metadata
2016-07-01 20:10:56 +01:00
Daniele Varrazzo
e41bff8ca4
Merge branch 'bug-424'
2016-07-01 19:28:02 +01:00
Daniele Varrazzo
80fd14463b
Mention closing bug #424 in the news
2016-07-01 19:27:31 +01:00
Daniele Varrazzo
5bcaf11f9d
Allow adapting bytes using QuotedString on Python 3 too
...
Close #365 .
2016-07-01 19:14:00 +01:00
Daniele Varrazzo
70af49c0a2
Fixed encoding tests on Py3
2016-07-01 18:50:24 +01:00
Daniele Varrazzo
9c156d41bb
Docs wrapping
2016-07-01 18:03:49 +01:00
Daniele Varrazzo
1442655d3c
Merge branch 'qstring-writable-encoding'
2016-07-01 18:03:12 +01:00
Daniele Varrazzo
4a450b63c4
Don't hope to encode stuff in an arbitrary encoding
...
libpq's PQescapeString will use the same encoding it has seen before in
a connection (static_client_encoding).
So I think I'll leave this feature here for people who know what is
doing, but won't really document it as a feature: it can't really work
in a generic way (unless adding some disgusting hack like creating a
fake connection with the encoding we want to call PQescapeStringConn
instead of PQescapeString).
2016-07-01 18:02:20 +01:00
Daniele Varrazzo
2e8e61b8d4
Test moved to the right module, cleanup, but same problem
2016-07-01 18:01:16 +01:00
Daniele Varrazzo
bada1f1f8e
Work in progress on writable encoding
...
Would help using adapt(unicode) to quote strings without a connection,
see ticket #331 .
Currently in heisenbug state: if test_connection_wins_anyway and
test_encoding_default run (in this order), the latter fail because the
returned value is "'\xe8 '", with an extra space. Skipping the first
test, the second succeed.
The bad value is returned by the libpq:
ql = PQescapeString(to+eq+1, from, len);
just returns len = 2 and an extra space in the string... meh.
2016-07-01 18:00:05 +01:00
Daniele Varrazzo
c29b5cd46a
Fixed build on win32
...
Fix #422 .
2016-07-01 02:24:49 +01:00
Daniele Varrazzo
7aedc61d41
Fixed segfault on repr() for uninitialized connections
...
Close #361 .
2016-07-01 02:11:21 +01:00
Daniele Varrazzo
b7330283bc
Wordsmithing on COPY commands
...
Address somehow issue #397 .
2016-07-01 01:40:25 +01:00
Daniele Varrazzo
52753b23e8
Document that the libpq must be available at runtime
...
Fix issue #408 .
2016-07-01 01:19:28 +01:00
Greg Ward
3ed2c54790
Fix scattered grammar/spelling errors in comments, debug output, etc.
2016-06-30 21:09:15 +01:00
Oleksandr Shulgin
d5443c65fd
Fix TODOs in ReplicationMessage inline docs
2016-04-21 15:32:05 +02:00
Gabriel Kihlman
5ce00f8e5b
Avoid a possible null deref, tz might be NULL.
...
Found by clang static analyzer.
2016-04-18 17:28:50 +02:00
Daniele Varrazzo
732ea90a4f
Merge pull request #373 from nonZero/patch-1
...
Suggest installing psycopg2 in windows using pip
2016-03-10 12:25:23 +00:00
Daniele Varrazzo
4fa1b983e7
Merge pull request #415 from bmwiedemann/master
...
dont claim copyright for future years
2016-03-10 12:22:59 +00:00
Daniele Varrazzo
caa3e491f2
Merge pull request #416 from dargor/doc_typos
...
Typo.
2016-03-10 12:22:01 +00:00
Daniele Varrazzo
3033361883
Merge branch 'py35'
2016-03-10 12:14:11 +00:00
Daniele Varrazzo
4fb236e688
Start advertising Py 3.5 support
2016-03-10 12:13:57 +00:00
Daniele Varrazzo
65ec7e8bcb
Fixed read() exception propagation in copy_from
...
Close issue #412 .
2016-03-10 12:13:52 +00:00
Daniele Varrazzo
82ef9cfadd
Merge branch 'msvc-2015-fix'
2016-03-10 12:12:40 +00:00
Daniele Varrazzo
48260c6406
Py 3.5 MSVC 2015 build fixed noted in news
...
Close issue #380 .
2016-03-10 12:12:24 +00:00
Christian Ullrich
654eeec24c
Work around late initialization in distutils._msvccompiler.
2016-03-10 12:12:19 +00:00
Daniele Varrazzo
1b7cebc41e
Merge branch 'setuptools'
2016-03-10 12:11:29 +00:00
Daniele Varrazzo
006693421d
Fixed 'make sdist' to work with setuptools
2016-03-10 12:10:51 +00:00
Daniele Varrazzo
2d91864977
setuptools in the news
2016-03-10 12:09:20 +00:00
Jason Erickson
22fe6e7aad
Modify setup.py to support setuptools/wheel
...
To support creation of whl files for PyPI, setuptools need to be imported
instead of distutils. Created try/except case to fall back to integrated
distutils if setuptools is not installed.
2016-03-10 12:09:15 +00:00
Daniele Varrazzo
8611d91b35
Fixed build on Python 2.5
2016-03-10 12:06:28 +00:00
Daniele Varrazzo
244f233e1c
Fixed manifest trying to include Makefiles from build env
2016-03-10 12:05:57 +00:00
Daniele Varrazzo
eb687103b4
Skip null array test on Postgres versions not supporting it
2016-03-10 12:04:41 +00:00
Daniele Varrazzo
499366ba2d
Merge branch 'patch-328'
2016-03-10 12:02:39 +00:00
Daniele Varrazzo
c13956dc10
Fixed compiler warnings about Py_ssize_t printf format
2016-03-10 12:02:23 +00:00
Jason Erickson
d0309333b7
Removed added Dprintf statements
...
Removed extra Dprintf statements added to trouble large objects
2016-03-10 12:02:06 +00:00
Jason Erickson
2cdc8d61a2
Fix Windows 64bit lobject support for very (>2GB) large objects
...
The type 'long' with Windows Visual C is 32bits in size for both 32bit and 64bit platforms. Changed type of variables that could be > 2GB from long to Py_ssize_t.
2016-03-10 12:02:00 +00:00
Gabriel Linder
88d3d7fc7e
Typo.
2016-03-09 21:51:02 +01:00
Bernhard M. Wiedemann
d829a75f2e
dont claim copyright for future years
...
otherwise, when building from unchanged source in 2018,
it would claim Copyright 2018
which is not true
Being able to reproduce identical output from identical input
is important to Linux distributions
2016-03-09 16:33:54 +01:00
Oleksandr Shulgin
a7887fab07
Merge remote-tracking branch 'zalando/feature/replication-protocol' into feature/replication-protocol-c-connection-object
2016-03-08 18:56:58 +01:00
Oleksandr Shulgin
3f10b4dd31
Remove duplicated doc for make_dsn()
2016-03-08 18:52:29 +01:00
Oleksandr Shulgin
b21c8f7a4e
Move replication-related imports to extras.py
2016-03-08 18:52:29 +01:00
Oleksandr Shulgin
2de2ed7c63
Remove some dead code
2016-03-08 18:52:29 +01:00
Oleksandr Shulgin
1d52f34e60
We don't need to expose cursor_init(), call tp_init() on the type instead.
2016-03-08 18:52:21 +01:00
Oleksandr Shulgin
da6e061ee8
Use python-defined make_dsn() for ReplicationConnection class
2016-03-08 18:52:21 +01:00
Oleksandr Shulgin
cb7032554e
Merge branch 'master' into feature/replication-protocol-c-connection-object
2016-03-04 10:52:10 +01:00
Daniele Varrazzo
ab5d8f4190
Style the dsn arg in connect() as a normal optional parameter
...
Plus some more connect() docs wordsmithing.
2016-03-03 17:28:56 +00:00
Daniele Varrazzo
d43b74681f
Merge branch 'make_dsn'
...
Close issue #363 instead of the proposed merge request.
2016-03-03 17:10:39 +00:00
Daniele Varrazzo
e33073576c
Brag about make_dsn in the NEWS file
2016-03-03 17:09:15 +00:00
Daniele Varrazzo
c9fd828f8a
Allow make_dsn to take no parameter
...
The behaviour of connect() is unchanged: either dsn or params must be
specified.
2016-03-03 17:09:15 +00:00
Daniele Varrazzo
7aab934ae5
Validate output result from make_dsn()
...
The output is not necessarily munged anyway: if no keyword is passed,
validate the input but return it untouched.
2016-03-03 17:09:15 +00:00
Daniele Varrazzo
7155d06cdc
Test that the empty dsn is a valid make_dsn input
2016-03-03 17:09:15 +00:00
Daniele Varrazzo
6893295a87
Added docs about make_dsn
...
connect() docs updated to document the arguments merging.
2016-03-03 17:09:15 +00:00
Daniele Varrazzo
52087a79d9
Added test suite specific for make_dsn
2016-03-03 15:31:37 +00:00
Daniele Varrazzo
2c55a1bd53
Verify that the dsn is not manipulated by make_dsn if not necessary
2016-03-03 15:07:38 +00:00
Daniele Varrazzo
1c4523f0ac
Implementation of make_dsn in Python
...
This is equivalent to what proposed in #363 , but with a much simpler
implementation.
2016-03-03 04:33:59 +00:00
Daniele Varrazzo
d40f81865f
Added parse_dsn() docstring
2016-03-03 03:25:47 +00:00
Daniele Varrazzo
01856333c4
Some order in the extensions doc
...
Classes, coroutine functions and extra functions grouped under separate
headings.
2016-03-03 03:21:59 +00:00
Federico Di Gregorio
3df2c6a2b7
Merge pull request #403 from kpinc/fix
...
Improve sentence.
2016-02-03 09:51:09 +01:00
Karl O. Pinc
3a54e83737
Improve sentence.
2016-02-02 12:48:16 -06:00
Federico Di Gregorio
b737757eac
Merge pull request #375 from kwotuveang3k4bk/patch-1
...
Update psycopg1.py
2016-01-31 12:55:52 +01:00
Oleksandr Shulgin
5d33b39829
Fix error test for invalid START_REPLICATION command.
2016-01-21 15:56:27 +01:00
Oleksandr Shulgin
09a4bb70a1
Allow retrying start_replication after syntax or data error.
2016-01-05 12:31:57 +01:00
Daniele Varrazzo
452fd56e04
Merge branch 'bug-382'
2015-12-16 12:04:14 +00:00
Daniele Varrazzo
5fd0f6c4ee
Fixed race condition on import in errorcodes.lookup
...
Fixes #382 .
2015-12-16 12:03:10 +00:00
mrmilosz
0772d187e9
Return input tuple in cur.callproc, factor code to use PQescapeIdentifier in single place
2015-12-13 01:10:03 -05:00
Daniele Varrazzo
92109e4bba
Correctly handle an empty error message from PQescapeIdentifier
2015-12-12 17:52:56 -05:00
Daniele Varrazzo
54e5349f53
Set an exception in case of PQescapeIdentifier error
...
Ifdeffed surface reduced.
2015-12-12 17:52:56 -05:00
Daniele Varrazzo
4003b7c977
Fixed callproc return value refcount
...
Temporary anyway: I want to go back returning a list (or dict).
2015-12-12 17:51:45 -05:00
Daniele Varrazzo
021f6d22ad
More straightforward param refcount handling in callproc
2015-12-12 17:51:45 -05:00
Daniele Varrazzo
7302f348bc
Added test with objects without length as callproc param
2015-12-12 17:51:08 -05:00
Daniele Varrazzo
d297976d6d
Raise TypeError if the dict in callproc param contains non-strings
...
Check-and-conversion chain fixed and simplified. 'spname' was a
reference leak.
2015-12-12 17:51:08 -05:00
Daniele Varrazzo
a3eed9c9f5
Added guard on params with no length on callproc
2015-12-12 17:51:08 -05:00
Daniele Varrazzo
04ce14b251
Avoid clobbering the exceptions raised by other calls
2015-12-12 17:49:59 -05:00
mrmilosz
c205f140a0
callproc: tests, docs, and comment/error-reporting touchups.
2015-12-12 17:49:59 -05:00
mrmilosz
37a80e9de8
callproc: checking for libpq 9.0+ on compile. yes: use PQescapeIdentifier. no: error
2015-12-12 17:49:44 -05:00
mrmilosz
3948e909e4
callproc: now more compliant with local coding standards.
2015-12-12 17:49:44 -05:00
mrmilosz
e9bb4a86f9
cursor.callproc: added a missing memory check
2015-12-12 17:49:25 -05:00
mrmilosz
31c95c0922
callproc using a dict now uses connection encoding and sanitizes parameter names
2015-12-12 17:49:25 -05:00
mrmilosz
1205bf9c2b
callproc using a dict now has a type check to make sure the keys are strings.
2015-12-12 17:49:25 -05:00
mrmilosz
23d279945f
cursor.callproc now also accepts dict for PostgreSQL 9+ "named notation"
2015-12-12 17:49:25 -05:00
Jan Janßen
b3def74002
Update psycopg1.py
2015-11-10 17:02:59 +01:00
Udi Oron
cf83470891
Suggest installing psycopg2 in windows using pip
...
pip is becoming the standard method for installing python packages, and now binary wheels are a better and easier option for users:
https://github.com/psycopg/psycopg2/issues/368
2015-11-10 00:35:02 +02:00
Oleksandr Shulgin
051e6d1364
Add skip_before_libpq for test_get_dsn_parameters
2015-10-30 13:02:45 +01:00
Oleksandr Shulgin
e61db578cf
Add dbname=replication for physical replication type.
2015-10-30 13:00:55 +01:00
Oleksandr Shulgin
602fefcae3
Fix typo in a new test name
2015-10-30 11:38:28 +01:00
Oleksandr Shulgin
a4cbb088fe
Add connection.get_dsn_parameters()
2015-10-30 11:10:41 +01:00
Oleksandr Shulgin
fbcf99ad07
Move replication connection to C level.
2015-10-27 18:21:24 +01:00
Oleksandr Shulgin
433fb957cb
Merge branch 'feature/connect2' into feature/replication-protocol
2015-10-27 17:37:18 +01:00
Oleksandr Shulgin
7aba8b3ed0
Rework psycopg2.connect() interface.
2015-10-27 17:35:57 +01:00
Oleksandr Shulgin
4b9a6f48f3
Merge branch 'master' into feature/replication-protocol
2015-10-27 12:16:41 +01:00
Oleksandr Shulgin
fe4cb0d493
Fix stale Dprintfs in pqpath.c referring to 'status'
2015-10-26 17:40:39 +01:00
Oleksandr Shulgin
8b79bf43ac
Drop ReplicationCursor.flush_feedback(), rectify pq_*_replication_*() interface.
2015-10-23 18:30:18 +02:00
Oleksandr Shulgin
dd6bcbd04f
Improve async replication example.
2015-10-23 17:51:03 +02:00
Oleksandr Shulgin
e69dafbecc
Move the decode
parameter to start_replication()
.
...
It makes more sense this way, because otherwise it must be passed to every call
of `read_message()`.
2015-10-23 11:31:55 +02:00
Oleksandr Shulgin
76c7f4a0b5
Use direct call to consume() callable in pq_copy_both()
2015-10-22 16:17:08 +02:00
Oleksandr Shulgin
22cbfb26d6
Actually add replication tests to the test suite.
2015-10-20 13:05:43 +02:00
Oleksandr Shulgin
089e745af6
Fix cursor_init() declaration for use in replication_cursor_type.c
2015-10-20 12:55:43 +02:00
Oleksandr Shulgin
b3f8e9adb5
Fix send_time printf format in replmsg_repr().
2015-10-20 12:54:22 +02:00
Oleksandr Shulgin
23abe4f501
Add quick start to the replication doc, minor doc fixes.
2015-10-20 12:36:13 +02:00
Oleksandr Shulgin
0bb81fc848
Properly subclass ReplicationCursor on C level.
2015-10-19 20:00:39 +02:00
Oleksandr Shulgin
7aea2cef6e
Improve async replication test.
2015-10-19 17:02:18 +02:00
Oleksandr Shulgin
4ab7cf0157
Replace stop_replication with requirement for an exception.
2015-10-19 15:42:42 +02:00
Oleksandr Shulgin
0435320f34
Fix PSYCOPG2_TEST_REPL_DSN handling.
2015-10-16 16:36:03 +02:00
Oleksandr Shulgin
cf4f2411bf
Fix async replication and test.
2015-10-15 18:01:43 +02:00
Oleksandr Shulgin
d14fea31a3
Use quote_ident from psycopg2.extensions
2015-10-15 12:56:21 +02:00
Oleksandr Shulgin
8e518d4954
Merge branch 'master' into feature/replication-protocol
2015-10-15 12:27:43 +02:00
Daniele Varrazzo
6763578cc0
Merge branch 'extensions-quote-ident'
2015-10-15 11:08:34 +01:00
Daniele Varrazzo
109409bc95
Mention quote_ident() in NEWS file
2015-10-15 11:06:44 +01:00
Oleksandr Shulgin
89bb6b0711
Proper unicode handling in quote_ident.
2015-10-15 11:52:18 +02:00
Oleksandr Shulgin
9ab38ee8c5
Add psyco_curs_datetime_init
2015-10-14 18:39:48 +02:00
Oleksandr Shulgin
28a1a00d1c
Remove commented copy_both code in pqfetch.
2015-10-14 18:39:20 +02:00
Oleksandr Shulgin
e3097ec956
Fix select/timeout indication in async replication example
2015-10-14 17:42:53 +02:00
Oleksandr Shulgin
822d671e8b
Clear repl_stop flag after the consume loop.
2015-10-14 17:40:39 +02:00
Oleksandr Shulgin
e05b4fd267
Add checks on replication state, have to have a separate check for consume loop.
2015-10-14 17:36:50 +02:00
Oleksandr Shulgin
9295bce154
Add psycopg2.extensions.quote_ident.
2015-10-14 17:00:25 +02:00
Oleksandr Shulgin
a0b42a12ff
Update stop_repl, require replication consumer to be a callable.
2015-10-14 15:15:07 +02:00
Oleksandr Shulgin
fea2260fc5
Fix stop_replication: always raise outside the loop.
2015-10-14 12:50:08 +02:00
Oleksandr Shulgin
54079072db
Fix ReplicationTest: no NotSupportedError now.
2015-10-14 12:43:26 +02:00
Oleksandr Shulgin
6ad299945f
Remove IDENTIFY_SYSTEM wrapper method (it can't work with async anyway).
2015-10-13 18:05:33 +02:00
Oleksandr Shulgin
ea2b87eade
Fix create_replication_slot doc signature
2015-10-13 11:01:13 +02:00
Oleksandr Shulgin
0233620c26
Rework replication connection/cursor classes
2015-10-01 19:33:27 +02:00
Oleksandr Shulgin
cac83da5db
Use parse_dsn in ReplicationConnectionBase
2015-10-01 19:33:24 +02:00
Oleksandr Shulgin
95ee218c6d
Update replication connection/cursor interface and docs.
2015-10-01 19:33:20 +02:00
Oleksandr Shulgin
937a7a9024
Cleanup start replication wrt. slot type a bit.
2015-10-01 19:33:16 +02:00
Oleksandr Shulgin
f872a2aabb
Remove typedef for uint32, include internal/c.h
2015-10-01 19:33:12 +02:00
Oleksandr Shulgin
862eda10c2
Merge remote-tracking branch 'origin/master' into repl
2015-10-01 19:29:17 +02:00
Daniele Varrazzo
c73c1c5771
Decref the ssl module after importing
2015-10-01 17:04:29 +01:00
Daniele Varrazzo
f635547ec6
The wait_select callback can cancel a query using Ctrl-C
...
Fixes #333 .
2015-10-01 15:26:13 +01:00
Daniele Varrazzo
9e6c3322d8
Fixed PersistentConnectionPool on Python 3
...
Fixes ticket #348 .
2015-10-01 14:44:14 +01:00
ClodoaldoPinto
98f2aad4ba
Typo correction
2015-10-01 14:31:31 +01:00
Daniele Varrazzo
ade7dba27c
MSVC 2015 compiler support added to news file
2015-10-01 14:30:17 +01:00
Daniele Varrazzo
7e94ce1f14
Drop spurious notices in test
...
Getting some "rehashing catalog" debug messages in PG 9.4
2015-10-01 13:31:13 +01:00
Daniele Varrazzo
14246a5689
Merge branch 'parse-dsn'
2015-10-01 13:29:10 +01:00
Daniele Varrazzo
58918801d6
Added parse_dsn() to news file
2015-10-01 13:26:11 +01:00
Daniele Varrazzo
5afeee3613
Added unicode support to parse_dsn
...
Also added support for the argument as a keyword.
2015-10-01 13:20:11 +01:00
Daniele Varrazzo
71d96293ab
Fixed parse_dsn tests on Python 3
...
On Python 3 there is no Exception.message attribute.
2015-10-01 12:03:00 +01:00
Daniele Varrazzo
d3bbd19ccb
Separate parse_dsn test in a test case of their own
2015-10-01 11:52:42 +01:00
Daniele Varrazzo
d1af12187c
Merge branch 'master' into parse-dsn
2015-10-01 11:39:51 +01:00
Daniele Varrazzo
6803341f21
Report NotSupportedError for PGRES_COPY_BOTH and PGRES_SINGLE_TUPLE
...
Fixes #352 .
2015-09-30 12:28:07 +01:00
Daniele Varrazzo
0e3f5214c5
Report the server response status on errors with no message
...
Suggested by Craig Ringer in pull request #353 , should also give more
information for other cases we were reported on flaky servers (AWS,
digital ocean...), see bug #281 .
2015-09-30 12:28:07 +01:00
Federico Di Gregorio
4e92322d74
Merge pull request #350 from Photonios/master
...
Fixes for MSVC 2015 (Python 3.5)
2015-09-23 11:50:25 +02:00
Photonios
71925fcc00
Fix for MSVC 2015: round has been added to this version
2015-09-22 18:26:14 +02:00
Photonios
ac25ba0a3f
Fix for MSVC 2015: isnan is supported in this version
2015-09-22 18:25:53 +02:00
Oleksandr Shulgin
26fe1f230f
Fix use of PQconsumeInput() in pq_read_replication_message()
...
The libpq's PQconsumeInput() returns 0 in case of an error only, but
we need to know if it was able to actually read something. Work
around this by setting an internal flag before retry.
2015-07-07 19:04:32 +02:00
Oleksandr Shulgin
eac16d048a
Fix missing GC flag in ReplicationMessage type
2015-07-03 15:44:45 +02:00
Oleksandr Shulgin
06f18237f7
Fix missing free in replmsg_dealloc
2015-07-03 11:40:00 +02:00
Oleksandr Shulgin
9c1f2acf3e
Check return value of PQsocket
...
When connection is closed by the server, we might get -1 there.
2015-07-02 14:39:51 +02:00
Oleksandr Shulgin
dab41c699a
Fix PQconsumeInput usage.
...
Only call when no data is available in the internal buffer.
2015-07-02 14:34:09 +02:00
Oleksandr Shulgin
9386653d72
Update docs on ReplicationCursor
2015-07-01 14:08:32 +02:00
Oleksandr Shulgin
0d731aa12e
Comment on special handling of PGRES_COPY_BOTH
2015-06-30 16:34:17 +02:00
Oleksandr Shulgin
318706f28c
Update docs for Replication protocol
2015-06-30 16:17:31 +02:00
Oleksandr Shulgin
058db56430
Merge remote-tracking branch 'zalando/feature/replication-protocol' into feature/replication-protocol
2015-06-30 10:40:52 +02:00
Oleksandr Shulgin
61e52ce879
Rework replication protocol
...
This change exposes lower level functions for operating the
(logical) replication protocol, while keeping the high-level
start_replication function that does all the job for you in
case of a synchronous connection.
A number of other changes and fixes are put into this commit.
2015-06-30 10:38:18 +02:00
Oleksandr Shulgin
e3c3a2c19e
Merge branch 'master' into feature/replication-message-object
...
Conflicts:
lib/extensions.py
2015-06-30 10:30:32 +02:00
Oleksandr Shulgin
9ed90b1216
Refer cursor from ReplicationMessage object. At the same time, for the sync use LSN instead of msg reference in cursor.
2015-06-11 14:52:01 +02:00
Oleksandr Shulgin
35a3262fe3
Expose ReplicationMessage type in extras
2015-06-11 12:20:52 +02:00
Oleksandr Shulgin
9fc5bf4436
Add handling of send_time field in replmsg
2015-06-10 18:21:06 +02:00
Oleksandr Shulgin
1ac385d1fb
Fix logical decoding plugin options adaptation on python3
2015-06-10 13:39:35 +02:00
Oleksandr Shulgin
453830f80c
Add ReplicationMessage object
2015-06-05 17:44:09 +02:00
Oleksandr Shulgin
f7b84ce843
Add {libpq,win32}_support.* to the .cproj file
2015-06-04 11:01:09 +02:00
Oleksandr Shulgin
50df864f8c
Add timersub for Win32. Fix gettimeofday on MinGW.
2015-06-04 11:00:08 +02:00
Oleksandr Shulgin
f14521f8cb
Add libpq_support.c and win32_support.c
...
Move libpq-specific code for streaming replication support into a
separate file. Also provide gettimeofday() on Win32, implementation
copied from Postgres core.
2015-06-03 14:10:20 +02:00
Daniele Varrazzo
925fdf5731
Fixed doc about libpq version availability
2015-06-02 17:11:09 +01:00
btubbs
06b4b1de94
Notify example should pop the oldest message in conn.notifies, not the newest.
2015-06-02 17:07:10 +01:00
Daniele Varrazzo
6002c524d6
Merge branch 'notice-lists-replaceable'
2015-06-02 17:04:25 +01:00
Daniele Varrazzo
1f330e9cac
Allow connection.notices and notifies to be replaced.
...
Close #326
2015-06-02 17:02:04 +01:00
Oleksandr Shulgin
44b705f88f
Improve identify_system: don't hardcode column names
2015-06-02 16:52:48 +02:00
Daniele Varrazzo
2ad82b973b
Pending notice list converted into a forward list
...
This allows inserting the elements in order without using list.insert().
2015-06-02 14:25:46 +01:00
Daniele Varrazzo
b326a27774
Dropped unneeded constness on the notice message
...
That's a strdup result, we 0wn it.
2015-06-02 14:24:48 +01:00
Daniele Varrazzo
0a7261268b
Dropped unused notice_filter connection member
2015-06-02 13:11:46 +01:00
Oleksandr Shulgin
d6041271bc
Separate parse_dsn test on URI, for libpq >= 9.2
2015-06-02 14:02:29 +02:00
Pete Hollobon
5712f30169
Change "non desiderable" to "undesirable" in docs
...
"desiderable" is considered obsolete
2015-06-02 13:00:25 +01:00
Daniele Varrazzo
7e5715617e
Merge branch 'adapt-list-of-none'
2015-06-02 12:49:15 +01:00
Daniele Varrazzo
b0058c0cc8
Fixed adaptation of lists of None
...
Note: lists of lists of None are not supported yet.
2015-06-02 12:48:24 +01:00
Oleksandr Shulgin
cc08e14162
Merge branch 'master' into feature/parse-dsn
...
Conflicts:
lib/extensions.py
2015-06-02 12:42:03 +02:00
Daniele Varrazzo
8d4ac25b56
Merge branch 'libpq-version'
2015-06-02 11:20:28 +01:00
Daniele Varrazzo
c2955fb8fc
Version function/constant docs improved
2015-06-02 11:20:02 +01:00
Daniele Varrazzo
5a21da43ee
Mention libpq version inspection in news file
2015-06-02 11:19:55 +01:00
Daniele Varrazzo
73d17e3c5e
Dropped PG_VERSION_HEX constant
...
At PostgreSQL 10.0 it would have become awkward.
2015-06-02 10:54:08 +01:00
Oleksandr Shulgin
80da76d43f
Get rid of postgres internal includes; check for Win32 for htonl()
2015-06-02 11:42:56 +02:00
Oleksandr Shulgin
ffd98a82c0
Add test for libpq_version
2015-06-02 11:12:16 +02:00
Oleksandr Shulgin
4bb6f9cef2
Add libpq version discovery
2015-06-01 18:05:11 +02:00
Oleksandr Shulgin
3200cd77bf
One more parse_dsn test for unquoted space
2015-06-01 15:18:03 +02:00
Oleksandr Shulgin
6a2f21aa14
Move parse_dsn to extensions, add tests
2015-06-01 15:11:12 +02:00
Oleksandr Shulgin
e32e1b834e
Add support for streaming replication protocol
...
Introduce ReplicationConnection and ReplicationCursor classes, that
incapsulate initiation of special type of PostgreSQL connection and
handling of special replication commands only available in this special
connection mode.
The handling of stream of replication data from the server is modelled
largely after the existing support for "COPY table TO file" command and
pg_recvlogical tool supplied with PostgreSQL (though, it can also be
used for physical replication.)
2015-06-01 11:45:04 +02:00
Oleksandr Shulgin
6c57e4a648
Add parse_dsn module function
...
Calls PQconninfoParse to parse the dsn into a list of keyword and value
structs, then constructs a dictionary from that. Can be useful when one
needs to alter some part of the the connection string reliably, but
doesn't want to get into all the details of parsing a dsn string:
quoting, URL format, etc.
2015-06-01 10:16:07 +02:00
Daniele Varrazzo
d66165232e
OpenSSL deadlock fix noted in NEWSfile
2015-05-03 12:27:37 +01:00
Jan Urbański
a59704cf93
Make sure libcrypto threadsafety callbacks are properly set up
...
Multithreaded programs using libcrypto (part of OpenSSL) need to set up
callbacks to ensure safe execution. Both Python and libpq set up those
callbacks, which might lead to a conflict.
To avoid leaving dangling function pointers when being unloaded, libpq sets up
and removes the callbacks every time a SSL connection it opened and closed. If
another Python thread is performing unrelated SSL operations (like connecting
to a HTTPS server), this might lead to deadlocks, as described in
http://www.postgresql.org/message-id/871tlzrlkq.fsf@wulczer.org
Even if the problem will be remediated in libpq, it's still useful to have it
fixed in psycopg2. The solution is to use Python's own libcrypto callbacks and
completely disable handling them in libpq.
2015-05-03 12:27:36 +01:00
Daniele Varrazzo
1b7e3c6da4
Improve docs about connection's with only closing the transaction
2015-05-03 12:01:06 +01:00
Daniele Varrazzo
ad3e91a56f
Unlock the connection after PQflush error
...
Apparently this has never happened... anyway the code path was wrong.
Fixes #294 .
2015-05-03 12:01:05 +01:00
Daniele Varrazzo
4078b89521
Added makefile target to upload docs
2015-05-03 10:30:33 +01:00
Daniele Varrazzo
1d006ccbe9
Added note about table names to be escaped in copy_*() methods.
2015-05-03 10:30:28 +01:00
Hyunjun Kim
4eee1207f9
Fix several typos
2015-05-03 10:30:21 +01:00
Daniele Varrazzo
2cab752443
Fix to MinTimeLoggingCursor.callproc() noted in NEWSfile
2015-05-03 10:30:16 +01:00
andrew deryabin
41639c7610
Fixed MinTimeLoggingCursor.callproc()
2015-05-03 10:30:11 +01:00
Daniele Varrazzo
f27ca25d2e
Wordsmith on connection.set_session()
...
Fixes #310 .
2015-05-03 10:30:05 +01:00
Daniele Varrazzo
70fbc8bf1f
Fixed connection.poll() docstring
...
Fixes #312
2015-05-03 10:29:57 +01:00
Daniele Varrazzo
0b523927bc
Docs build process and docs cleaned up
2015-04-28 09:32:58 +01:00
Daniele Varrazzo
1e8be5bd09
Added missing files needed to build the docs
...
Fixes #291
2015-04-28 08:38:57 +01:00
Daniele Varrazzo
c62c292053
Bump to next dev version number for the master branch
2015-04-28 08:38:41 +01:00
Daniele Varrazzo
5efe7131ff
Version bumped for release 2.6
2015-02-09 09:43:55 +00:00
Daniele Varrazzo
6d63973e08
More portable way to establish Python 32/64 build
2015-02-08 22:52:50 +00:00
Daniele Varrazzo
569fd0975b
Python 3.1 bytes.decode() doesn't support keyword arguments
...
Sucker.
2015-02-08 19:43:09 +00:00
Daniele Varrazzo
296caa4556
More tests tweaks
...
Named cursors on old server versions have a different prefetch behaviour.
This has hidden me the supported range of the 24:00 time format.
Let's have another go at full testing...
2015-02-08 12:51:36 +00:00
Daniele Varrazzo
7ea56b112e
Make Column picklable on Python >= 3.3
...
Also expose the type from the extensions module, not from the main
module.
2015-02-08 11:27:10 +00:00
Daniele Varrazzo
6177823811
Don't test date 24:00 before PG 8.4
2015-02-08 10:30:48 +00:00
Daniele Varrazzo
2a2f306f7b
Added NEWS note about picklable cursor.desciption
2015-02-08 02:32:47 +00:00
Owen Raccuglia
5af5fb4cc6
Allow pickling of cursor.description
...
This is for people using dtuple.py; a dtuple.DatabaseTuple instance
keeps a reference to cursor.description, which is not picklable because
psycopg2 doesn't export the Column namedtuple it uses.
This commit exports the Column namedtuple, and includes a test to verify
the pickle/unpickle works after exporting Column.
2015-02-08 02:31:33 +00:00
Daniele Varrazzo
54ebf90fc6
Document that LO64 is only available on Py 64 builds
2015-02-08 02:21:22 +00:00
Daniele Varrazzo
f15e9d0cc8
Fixed link in NEWS entry
2015-02-08 02:14:00 +00:00
Daniele Varrazzo
e490e3bfa3
Accept overflow errors testing for LO64 funcs
...
It is raised on 32 bits by PyArg_ParseTuple. We may work around on
truncate (maybe parsing a py_ssize_t) but we would have the same problem
on seek as the offset is signed.
2015-02-08 02:04:41 +00:00
Daniele Varrazzo
7ce7fef322
Propagate read error messages in COPY FROM
...
Fix ticket #270 .
2015-02-08 01:42:21 +00:00
Daniele Varrazzo
d3c1ad5945
Convert Postgres time 24:00 into 00:00
...
Fix ticket #278 .
2015-02-08 00:41:50 +00:00
Daniele Varrazzo
2332f2c99e
Merge branch 'timetz'
2014-12-25 15:09:15 +01:00
Daniele Varrazzo
b5ac992944
Merge branch 'lo64'
2014-12-25 15:08:02 +01:00
Daniele Varrazzo
7139187381
Large object 64 bit API quoted in news file
2014-12-25 15:07:34 +01:00
Daniele Varrazzo
a338da9c19
Fixed typo in tests
2014-12-25 15:06:18 +01:00
Daniele Varrazzo
c008f9d1ce
Added documentation about the lo64 support
2014-12-25 15:06:18 +01:00
Daniele Varrazzo
bc5e2aeead
Keep into account psycopg build in lo64 tests
2014-12-25 15:06:18 +01:00
Daniele Varrazzo
2f862972c9
Guard against overflows when using the lo32 api
...
If psycopg supports lo64 but the server doesn't the user may pass values
that would overflow the api range, resulting in:
lo.seek((2<<30))
*** OperationalError: ERROR: invalid seek offset: -2147483648
Also improved the error messages and guard against INT_MIN for negative
seek offsets.
2014-12-25 15:06:18 +01:00
Daniele Varrazzo
79df47a146
Fixed mismatched types in debug print
2014-12-25 15:06:18 +01:00
Daniele Varrazzo
44219bf366
Don't try and compile lo64 support on 32 bits Python
...
We can't fit more than 31 bits in a long anyway.
2014-12-25 15:06:18 +01:00
Daniele Varrazzo
b2327b0fc7
Add the flag 'lo64' to the version if psycopg supports the lo_*64 api
2014-12-25 15:06:18 +01:00
Daniele Varrazzo
0205d6ca2e
Use ifdef instead of if to check LO64
2014-12-25 15:06:18 +01:00
Daniele Varrazzo
91eabf5fcb
Fixed check for PG version
...
It would have failed in PostgreSQL 10.0.
2014-12-25 15:06:18 +01:00
Blake Rouse
e5bbde9554
Check server_version before using lo_*64 functions. If less tahn 9.3 old none 64bit functions will be use.
2014-12-25 15:06:18 +01:00
Blake Rouse
cd67d3d2fe
Modify truncate to use lo_truncate64. Use HAVE_LO64 define to use new lo_*64 methods. Check size of offset and length for versions without LO64.
2014-12-25 15:06:18 +01:00
Blake Rouse
e13ec67da3
Use lseek64 and ltell64 to support large object greater than 2gb in size.
2014-12-25 15:06:18 +01:00
Daniele Varrazzo
6bccb05c90
timetz adaptation documented
2014-12-25 14:57:31 +01:00
Federico Di Gregorio
85ba098cd8
Merge pull request #273 from eriklee/master
...
Correct exausted -> exhausted typo in exception
2014-11-17 22:36:47 +01:00
Erik Lee
e9f54a2d6e
Correct exausted -> exhausted typo
2014-11-17 17:01:00 +00:00
Federico Di Gregorio
096e0729d5
Merge pull request #272 from yoloseem/timetz
...
Cast time into timetz when the tzinfo field is set.
2014-11-13 10:07:02 +01:00
Hyunjun Kim
4dbda02145
Cast time into timetz when the tzinfo field is set.
2014-11-13 17:32:06 +09:00
Federico Di Gregorio
0d553269d5
Merge pull request #271 from tokheim/master
...
Correction to type adaption example
It is OK for an adapted object to return the escaped string on
__str__ calls but getquoted() is the canonical method.
2014-11-03 21:21:10 +01:00
Asmund Tokheim
ab4afd0e2f
Correction to type adaption example, making it more transparent
2014-11-02 14:15:51 +01:00
Daniele Varrazzo
1b48033345
Don't try to close the server cursor in error state
...
`close()` is implicitly called by `__exit__()`, so an exit on error
would run a query on a inerr connection, causing another exception
hiding the original one. The fix is on `close()`, not on `__exit__()`,
because the semantic of the latter is simply to call the former.
Closes #262 .
2014-09-16 06:57:34 +01:00
Daniele Varrazzo
48a32b766b
In 2010 I couldn't speak English
2014-09-16 06:57:34 +01:00
Tomer Chachamu
6de7315210
Fix typo in docs
2014-09-01 16:29:38 +01:00
Daniele Varrazzo
b4d38c455c
Don't need to build the env for a sdist
...
After 2.5 we are not releasing the html docs in the sdist anymore.
2014-09-01 16:29:38 +01:00
Daniele Varrazzo
7faa06ce0b
Added scripts to release and upload docs
2014-09-01 16:29:38 +01:00
Daniele Varrazzo
9fdfa86200
Release notes cleanup before releasing 2.4.5
2014-08-31 03:06:50 +01:00
Daniele Varrazzo
6210af2763
Fixed excessively strict notices test
...
Failing with PG 9.4 because it generates other debug messages during the
test run (rehashing catalog cache).
2014-08-31 03:06:33 +01:00
Daniele Varrazzo
8e06a51884
Added plural version of the tickets role
2014-08-31 03:05:03 +01:00
Daniele Varrazzo
7d81c48849
Point tickets to GitHub instead of Lighthouse
...
Keep into account the numbers reshuffling: Lighthouse bugs with a number
matching a GitHub merge request are shifted ahead.
2014-08-31 03:05:03 +01:00
Daniele Varrazzo
37d80f2c03
Use the readme as PyPI desctiption
2014-08-31 02:59:49 +01:00
Daniele Varrazzo
6705e4051d
Dropped creation of errcodes with missing spec field
...
On further inspection these names are just aliases for values already
defined: we don't need the duplication.
2014-08-28 02:17:57 +01:00
Daniele Varrazzo
ccc30e1877
Clear adapters in test to maintain reference count
2014-08-28 02:17:54 +01:00
Daniele Varrazzo
2d601ef157
Fixed memory leak with large objects
...
Deallocating closed large objects failed to decrement the connection
refcount. The fact the lobject is closed doesn't matter for refcount.
Issue detected by the always useful scripts/refcounter.py
With an extra bit of unrequested whitespace love.
2014-08-28 02:17:52 +01:00
Daniele Varrazzo
ea54aa77ed
Added test to verify _psycopg can be imported
2014-08-28 02:17:49 +01:00
Daniele Varrazzo
54d904138d
Don't import psycopg2.tz into the C extension
...
This makes possible to import _psycopg directly, after adding the
package directory to the pythonpath. This enables hacks such as:
sys.path.insert(0, '/path/to/psycopg2')
import _psycopg
sys.modules['psycopg2._psycopg'] = _psycopg
sys.path.pop(0)
which can work around e.g. the problem of #201 , freeze that cannot
freeze psycopg2. Well, freeze cannot freeze it because it's just not
designed to deal with C extensions. At least now the frozen application
can hack the pythonpath and work around the limitation by importing
_psycopg as above and then doing the rest of the imports normally.
Keeping long-lived references to python objects is bad anyway: the
tz module couldn't be reloaded before.
2014-08-28 02:17:46 +01:00
Daniele Varrazzo
df9fbc515d
Direct link to the install docs in the readme
2014-08-24 23:33:14 +01:00
Daniele Varrazzo
f7ee006bef
Use virtualenv as build environment for the docs
2014-08-24 23:11:07 +01:00
Daniele Varrazzo
4a4e0d8f9a
Self-updating copyright year in docs
2014-08-24 23:07:22 +01:00
Daniele Varrazzo
c1da93a7b2
Document we known 9.4 errorcodes
2014-08-24 22:11:21 +01:00
Daniele Varrazzo
b8b15637aa
Take the PYTHONPATH into account when building the docs
2014-08-24 22:11:02 +01:00
Daniele Varrazzo
2ad67ee56e
Move the extras
module up in the docs
...
It is more interesting than `tz` and `pool`.
2014-08-24 22:10:24 +01:00
Daniele Varrazzo
843de765a1
Fixed doc example about Error attributes
...
Catch the Error, not everything!
Also, whitespaces.
2014-08-24 22:08:33 +01:00
Daniele Varrazzo
afdb7422fb
Merge branch 'clean-text-files'
2014-08-24 02:06:27 +01:00
Daniele Varrazzo
c0e94ad01f
Dropped outdated HACKING file
2014-08-24 02:06:09 +01:00
Daniele Varrazzo
2be26804d3
Dropped content from the INSTALL file
...
The docs have it right.
2014-08-24 02:06:09 +01:00
Daniele Varrazzo
d8bbaf0481
Added info about running the test suite in the docs
...
They were in the INSTALL file, which is quite out-of-date now.
Also fixed a couple of other things.
2014-08-24 02:06:09 +01:00
Daniele Varrazzo
353b36c657
Readme cleaned up and converted to reST
...
Dropped outdated info and references to the INSTALL, which is less
up-to-date than the docs.
Converted to reST to have it prettier on GitHub.
2014-08-24 02:06:09 +01:00
Daniele Varrazzo
0ea7798122
Merge branch 'drop-flags'
2014-08-24 02:05:23 +01:00
Daniele Varrazzo
1d729ab40e
Dropped HAVE_PQFREEMEM flag
...
It was necessary before PG 7.4, in versions which have long been unsupported.
2014-08-24 01:43:12 +01:00
Daniele Varrazzo
68a4308c3d
Dropped PSYCOPG_NEW_BOOLEAN flag
...
Introduced in 2.0 beta 8, 2006 A.D. Went absolutely untouched in 8 years
of refactoring, when Python 2.5 and PostgreSQL 8.1 roamed the earth.
I would say it has stood the test of the time.
2014-08-24 01:25:02 +01:00
Daniele Varrazzo
6e841a41e6
Dropped PSYCOPG_EXTENSIONS flag
...
Building without extensions has been long broken and nobody really cares
about a pure-DBAPI implementation (which could be created using a wrapper
instead).
2014-08-23 19:30:48 +01:00
Daniele Varrazzo
6a5f778361
Merge branch 'withhold-transactions'
2014-08-21 05:55:11 +01:00
Daniele Varrazzo
d20c03310d
Document WITH HOLD corrections.
2014-08-21 05:53:07 +01:00
Alexey Borzenkov
13b0852619
Allow using named with hold cursors in autocommit
2014-08-21 05:35:11 +01:00
Daniele Varrazzo
c81522079e
Added test to verify withhold cursors work in autocommit
2014-08-21 05:35:11 +01:00
Alexey Borzenkov
478e66f761
No implicit transaction on named cursor close
...
Also, don't start an implicit transaction when fetching with
named with hold cursor, since it already returns results
from a previously committed transaction.
2014-08-21 05:35:10 +01:00
Daniele Varrazzo
283a422b4d
Added test to verify withhold transaction behaviour
...
A withhold cursor can read its data when the transaction is closed, so
it shouldn't start a new one upon movement/close.
2014-08-21 05:35:10 +01:00
Daniele Varrazzo
a2b01cdf42
Dropped simple type wrapper functions
...
These functions don't need to exist: exposing the type in the module is
enough. It is actually better as one may use isinstance and such.
2014-08-15 02:54:31 +01:00
Daniele Varrazzo
1b322a9b19
Fixed segfault in List function
...
This function is never called: it segfaults 100%. To be removed.
2014-08-15 02:54:25 +01:00
Daniele Varrazzo
95165cef7d
Dropped almost-no-op customized objects repr()
...
The default repr is enough: it prints <TypeName at 0xADDR> instead of
<TypeName object at 0xADDR>.
The only people being hurt by this change are the ones using doctests:
they deserve it.
2014-08-15 02:54:10 +01:00
Daniele Varrazzo
669e787919
Name the types after the module they are exposed from
2014-08-15 01:47:19 +01:00
Daniele Varrazzo
31d07e5029
Scrape PostgreSQL 9.4 error codes table too
...
No new error code found as of 9.4 beta2.
2014-08-13 02:44:59 +01:00
Daniele Varrazzo
41a083cec3
Convert pool arguments to int
...
Failing to do so may cause dangerous misbehaviours such as an unbounded
pool (because of lame comparison operators in Python 2).
Fix ticket #220 .
2014-08-13 02:39:16 +01:00
Daniele Varrazzo
c475a0db95
Document PostgreSQL 9.4 as supported
...
Actually there is a test failing in the test suite in PG 9.4beta2, but
it's probably because the default logging level is to DEBUG. Will wait
for the final release to check if the test is to be fixed. All other
tests pass no problem.
2014-08-13 02:09:04 +01:00
Daniele Varrazzo
0b95194f74
Merge branch 'jsonb'
2014-08-13 02:03:11 +01:00
Daniele Varrazzo
e225aad042
Habemus jsonb
2014-08-13 02:02:06 +01:00
Daniele Varrazzo
f40ad93a37
Added jsonb docs
2014-08-13 02:02:04 +01:00
Daniele Varrazzo
9d547469b8
Add register_default_jsonb() and register the type
2014-08-13 02:02:01 +01:00
Daniele Varrazzo
6bca443e37
Added name param to register_json()
2014-08-13 02:01:55 +01:00
Daniele Varrazzo
634fc004fb
Added wishful test suite for jsonb type
2014-08-13 02:01:51 +01:00
Daniele Varrazzo
44281d6692
Fix supported Py/PG versions in docs
2014-08-04 22:39:52 +01:00
Daniele Varrazzo
6d6fd9acf7
Parse errocodes for PG 9.3 too
...
There is no new errcode defined so no need to release this as a change,
only change the docs.
2014-07-31 13:35:04 +01:00
Daniele Varrazzo
40dca9924d
Add a few missing errcodes
...
They are used in the code but not defined in the SGML docs so the script
failed to parse them.
2014-07-31 13:34:53 +01:00
Daniele Varrazzo
081bf843d2
Parse the error codes from the text file if available
...
The text file was added in PG 9.1. It contains a few errors not available
in the SGML.
2014-07-31 13:33:36 +01:00
Daniele Varrazzo
56adc590ff
Fixed segfault if COPY statements are executed
...
Close ticket #219
2014-06-06 21:42:21 +02:00
Daniele Varrazzo
115ceea1eb
Don't ignore silently the cursor.callproc
argument without a length
2014-06-06 21:42:21 +02:00
Daniele Varrazzo
e076e935b9
Added test with objects without length as callproc param
2014-06-06 21:42:20 +02:00
Chris Mildebrandt
693dedf4da
cleanup remaining GPL license text
2014-05-20 09:50:53 -07:00
Chris Mildebrandt
67354ed14f
cleanup remaining GPL license text
2014-05-20 09:42:41 -07:00
Jason Erickson
8746b0c6b7
Skip test_cleanup_on_badconn_close on Windows
...
The Windows server version of PostgreSQL uses a function called pgkill in the
file kill.c in place of the UNIX kill function. This pgkill function
simulates some of the SIGHUP like commands by passing signals through a named
pipe. Because it is passing the signal through a pipe, the server doesn't get
the kill signal immediately and therefore fails the test on
test_connection.ConnectionTests.test_cleanup_on_badconn_close.
Ideally, the test should check to see if the server is running on Windows, not
the psycopg.
2014-05-19 12:15:53 +01:00
Jason Erickson
c5f2e29dde
Added select.select timeout on AsyncTests.wait
...
On Windows, the select.select() hangs/waits forever on the
test_async_connection_error_message() test. Adding a 10 second timeout
allows the tests to continue.
2014-05-19 12:15:52 +01:00
Daniele Varrazzo
97290955f6
Python 3.4 declared supported
2014-05-13 14:36:28 +01:00
Daniele Varrazzo
d0b35adeb6
Parse the rowcount as long
2014-05-13 14:34:10 +01:00
Daniele Varrazzo
35545e7374
Skip rowcount on copy test on postgres < 8.2
...
It looks like the server doesn't send the message.
2014-05-13 14:34:09 +01:00
Daniele Varrazzo
81b5f1fb26
Copy operations correctly set the cursor.rowcount attribute
...
Fixes ticket #180 .
2014-05-05 23:53:50 +01:00
Daniele Varrazzo
abd975ae40
set_session() params documented in a more Python-friendly way
2014-05-05 23:06:23 +01:00
Daniele Varrazzo
69605e54ec
Fixed explicit connection.cursor(cursor_factory=None)
...
Fixes issue #210 .
2014-04-30 17:57:55 +01:00
Daniele Varrazzo
03b8b1e97a
Merge branch 'connection-closed'
...
NEWS for released 2.5.3 reordered.
2014-04-05 16:11:19 +01:00
Daniele Varrazzo
09fb131f1a
Don't specify 0 or 1 in closed docs
...
There's also 2 which means broken. But I prefer to leave that as
implementation detail.
2014-04-05 16:03:19 +01:00
Daniele Varrazzo
489658cfc5
Close the connection if discovered bad on poll()
2014-04-05 16:03:19 +01:00
Daniele Varrazzo
1654687d1b
Check the connection is really bad on exception before closing it
...
We end up here without a pgres sometimes (e.g. from lobject errors)
2014-04-05 16:03:06 +01:00
Daniele Varrazzo
3752880b7b
Fixed attempt of closing an already closed lobject on dealloc
...
This results in a "null without exception set" in the corrent state, which
is caused by the connection being unexpectedly closed anyway.
2014-04-05 16:03:06 +01:00
Daniele Varrazzo
2e55b35d5d
Don't set an exception witout GIL closing lobjects with a bad conn
...
We ended up in this branch only for an excessively aggressive closing
of the transaction that now I'm going to fix.
2014-04-05 16:03:06 +01:00
Daniele Varrazzo
696d123550
Close a connection if PQexec returned NULL
...
This happens for Socket connections, not for TCP ones, where a result
containing an error is returned and correctly handled by pq_raise()
Closes ticket #196 but not #192 : poll() still doesn't change the
connection closed.
2014-04-05 16:03:06 +01:00
Daniele Varrazzo
a31c1a1722
Allow get_transaction_status on closed connections
...
It's a local operation and the libpq functions has a NULL guard.
2014-04-05 16:02:43 +01:00
Daniele Varrazzo
9036299d54
Avoid printing the typecast name in debug statement
...
The way we were doing it is unsafe and causes assertion failures on Py3.
Fixes ticket #188
2014-04-04 19:25:09 +01:00
Daniele Varrazzo
ca98167ae4
Fixed use of Python object with refcount 0 in cursor_init
...
Caused segfault running test_cursor.CursorTests.test_invalid_name under
Python 3.4 built in debug mode.
2014-04-04 19:20:08 +01:00
Daniele Varrazzo
81443c3a65
Work around pip issue #1630 breaking 'pip -e git+url'
...
https://github.com/pypa/pip/issues/1630
Fixes ticket #18 (opened in 2010!)
2014-04-04 18:07:05 +01:00
Daniele Varrazzo
33f2301772
Clarify in the docs that mogrify() and query always return bytes
2014-04-03 02:46:54 +01:00
Daniele Varrazzo
e9661bcde5
Fixed bug number typo in NEWS file
2014-04-03 02:45:57 +01:00
Daniele Varrazzo
a8fdc74090
Fixed overflow opening a lobject with an oid not fitting in a signed int
...
Fixes 🎫 `203`.
2014-04-03 02:35:56 +01:00
Daniele Varrazzo
dfacc483b5
Dropped unneeded pass in test
2014-04-03 02:32:05 +01:00
Daniele Varrazzo
25e3a5f744
Explicit the fact that closed connections have undefined status
2014-04-03 02:07:38 +01:00
Daniele Varrazzo
e7fc7f31b9
Fixed dsn and closed attributes in failing connection subclasses.
...
From ticket #192 discussion.
2014-04-03 01:42:35 +01:00
Erwin de Keijzer
0258e90ef0
Fixed DNS typo in examples
2014-03-24 18:36:33 +01:00
Daniele Varrazzo
7b82be936d
Don't segfault on uninitialized cursor
...
It can happen with bad cursor subclasses not calling super's init. Raise
an exception instead of segfaulting.
Closes #195
2014-02-26 19:41:59 +00:00
Daniele Varrazzo
618f7e41de
Use the do-while 0 idiom for cursor guards macro
2014-02-26 19:31:27 +00:00
Daniele Varrazzo
3c893606f5
Merge branch 'ticket-194'
2014-02-24 15:20:13 +00:00
Daniele Varrazzo
79e84e432a
Bug #194 confirmed fixed: newsfile updated.
2014-02-24 15:20:01 +00:00
Daniele Varrazzo
63e36e22d2
Set the connection async before polling for connection
...
It should fix ticket #194
2014-02-24 15:20:01 +00:00
Daniele Varrazzo
ca99579b76
Set the connection async earlier in green mode
...
The moment it is called shouldn't have really changed, but it's more
explicit when it happens. Previously it was sort of obfuscated behind a
roundtrip through the green callback and poll.
2014-02-24 15:20:01 +00:00
Daniele Varrazzo
283dbccf56
Merge branch 'range_sort'
2014-02-22 23:02:19 +00:00
Daniele Varrazzo
dd9e476353
Fixed error message on range parsing failed
2014-02-22 23:02:07 +00:00
Daniele Varrazzo
8d2744c550
Mention Range order in the news file
2014-02-22 23:01:22 +00:00
Daniele Varrazzo
212f4e3538
Docs wordsmithing about Range order
2014-02-22 23:01:02 +00:00
Daniele Varrazzo
8937c635df
Hardcode the list of attributes to be used in comparison
...
Comparing Range subclasses may lead to surprises.
2014-02-22 21:52:44 +00:00
Daniele Varrazzo
4545d1636c
Added implementation for Range gt and ge operators
...
Using a common implementation for all the operators. Note that lt is the
one used by sort so it's nice it's the fastest.
2014-02-22 21:51:28 +00:00
Daniele Varrazzo
6192a4fb17
Added str() for the Json adapter
...
Fixes ticket #191 .
2014-02-22 20:45:35 +00:00
Chris Withers
6cd0647da9
documentation changes now that Range objects can be ordered
2014-02-18 21:24:59 +00:00
Chris Withers
e60266c4c5
New implementation of Range sorting that works for Python 2.5 to 3.3, at least.
2014-02-18 20:55:00 +00:00
Chris Withers
bae508ffa6
Coding style changes.
2014-02-14 07:46:32 +00:00
Chris Withers
d469c32503
Provide a stable and consistent sort order for Range objects.
...
This matches postgres server-side behaviour and helps client applications that need to sort based on the primary key of tables where the primary key is or contains a range.
2014-02-12 08:11:59 +00:00
Daniele Varrazzo
66f85b5832
Merge branch 'outputres'
2014-01-14 21:54:28 +00:00
Daniele Varrazzo
a35b743af7
Mention outputres fix in NEWS file
2014-01-14 21:52:42 +00:00
Daniele Varrazzo
4ed9dc1435
Added doc notes about how to avoid JSON parsing
...
Added FAQ too as it has bitten more than one user
(see tickets #172 , #190 ).
2014-01-14 18:33:05 +00:00
James Emerton
58c98deebb
Fallback when get_ext_fullpath() is unavailable
2014-01-10 13:41:16 -08:00
James Emerton
9100ad3e8f
Use get_ext_fullpath() for -outputresource
...
The manifest fixup was relying on the extension name being "_psycopg.pyd" which effectively prevents building with --debug as the extension name becomes "_psycopg_d.pyd" in this instance.
2014-01-10 11:56:14 -08:00
Daniele Varrazzo
85b1914ad6
Fixed dealloc of lobject->smode
...
I put it by mistake into the in the self->conn checked block in the
previous commit.
2013-11-27 13:00:16 +00:00
Daniele Varrazzo
e11d0d39ec
Check connection type in lobject init
...
Fixes ticket #187 .
2013-11-27 12:44:28 +00:00
Daniele Varrazzo
6ab1ec1c37
Typo fixes and improvements to new_array_type() docs
2013-10-21 15:27:31 +01:00
Daniele Varrazzo
bc70902ea5
Use bytestrings in infinite dates adapter example
...
Returning strings would result in unclear tracebacks on Py3 (see ticket #163 ).
2013-10-21 14:30:25 +01:00
Daniele Varrazzo
2e3833f7fb
Really test named cursors in test_scroll_named()
2013-10-16 19:10:21 +01:00
Daniele Varrazzo
5c99d2a456
Document that named cursors don't raise an exception going out-of-bound
...
See issue #174 for the details.
2013-10-16 19:10:20 +01:00
Daniele Varrazzo
a0a63e3ac7
Document that using %, (, ) in the placeholder name is not supported
2013-10-16 17:50:11 +01:00
Daniele Varrazzo
1e623a951c
Meaningful connection errors report a meaningful message
...
Fixes issue #173 .
2013-10-16 17:50:10 +01:00
Daniele Varrazzo
345077d5f7
Fixed pickling of exceptions with no pgerror/pgcode set
...
Fixes ticket #170 .
2013-07-19 16:05:59 +01:00
Daniele Varrazzo
81e8b869d0
Fixed titles in newsfile
...
The first title at the same level of the main releases helps getting a
more regular ToC in the docs main page.
2013-07-19 16:02:31 +01:00
Daniele Varrazzo
497247a528
Fixed doc index entry for infinite dates
2013-06-23 02:14:01 +01:00
Daniele Varrazzo
921b676471
Untrack the connection before closing to avoid possible double-free
...
From Gangadharan S.A. Fixes issue #166 .
2013-06-20 16:35:43 +01:00
Daniele Varrazzo
83c5d12cf1
Added doc example to convert date.max to infinity
...
See issue #163 .
2013-06-18 15:00:30 +01:00
Daniele Varrazzo
ea08f7e7c7
Merge branch 'range_eq_typerror'
2013-06-18 14:14:01 +01:00
Daniele Varrazzo
1361189b99
Mention the Range eq fix in the NEWS file
2013-06-18 14:13:00 +01:00
Daniele Varrazzo
d50ea3d82b
Uniform Range eq tests style
2013-06-18 14:10:49 +01:00
Chris Withers
28276e3eb1
cater for comparison of subclasses
2013-05-26 22:20:07 +01:00
Chris Withers
b6a9e0ffaf
raising an exception here rather than returning False causes problems with SQLAlchemy's internal state tracking
2013-05-26 21:58:39 +01:00
Chris Withers
8bb44f3444
more useful error message when comparing ranges with non-ranges
2013-05-26 21:20:40 +01:00
Daniele Varrazzo
1ef234ebfc
Added regression test for infinity parsing in dates
...
...and a couple of typos.
2013-05-11 02:19:59 +01:00
Daniele Varrazzo
c796bc2cbd
Added test to verify copysize handling in copy_expert
...
Not an original psycopg2 bug but present in pure python implementation,
e.g. ctypes issue #25 and cffi issue #5 .
https://github.com/mvantellingen/psycopg2-ctypes/issues/25
https://github.com/chtd/psycopg2cffi/pull/5
2013-05-06 10:48:10 +01:00
Daniele Varrazzo
a44db81d9b
Skip tests on python implementations without getrefcount()
...
PyPy is one of these.
2013-05-06 10:39:24 +01:00
Daniele Varrazzo
bbe0bf955c
A few docs fixes to the usage page
2013-05-01 22:40:19 +01:00
Daniele Varrazzo
1ff3ea0745
Dropped a lot of words from the front matter
...
Replaced with links to the types adaptation table and the extension docs.
2013-04-26 10:06:26 +01:00
Piotr Kasprzyk
31b6ec63f8
Fix multiple misspellings
2013-04-26 09:59:40 +01:00
Daniele Varrazzo
2eba97de70
Merge branch 'classifiers'
2013-04-21 21:44:57 +01:00
Daniele Varrazzo
4547753df0
Added explicit Python 2 and Python 3 classifiers
...
Not sure, but I suspect the "python3" page on PyPy in only based
on the Language :: Python :: 3 classifier, not the more specific ones
2013-04-21 21:43:55 +01:00
Saul Shanabrook
4de8b9577e
Explicit Python Version Support
...
Used supported versions from http://initd.org/psycopg/docs/install.html
2013-04-21 21:35:58 +01:00
Daniele Varrazzo
fc2ca0d2e9
Make sure to return a bytes string from numeric range adapter
2013-04-21 20:30:50 +01:00
Daniele Varrazzo
d159dfea9d
Merge branch 'solaris-round'
2013-04-21 18:39:30 +01:00
Daniele Varrazzo
fdc5dc750c
Mention Solaris round fix in NEWS file
2013-04-21 18:37:19 +01:00
Daniele Varrazzo
e335eb98ce
Long ifdef reformatted for readibility
2013-04-20 02:21:58 +01:00
Daniele Varrazzo
5d86d07618
Testing external script independent from psycopg implementation
...
Patch needed to run the test suite on psycopg2cffi or psycopg2ct.
2013-04-19 23:01:28 +01:00
Daniel Enman
558f7ad929
Remove extra ||
2013-04-18 17:12:14 -03:00
Daniel Enman
cda0b6a8eb
Solaris 10+, and illumos distros have round()
2013-04-18 16:59:26 -03:00
Daniele Varrazzo
711c092a79
The UUID adapter returns bytes instead of str in Python 3
...
Also added __conform__ method to the adapter.
2013-04-07 22:19:04 +01:00
Daniele Varrazzo
61d496b2ed
Script to test ticket #58 moved into sandbox
...
We don't need it distributed in the sdist
2013-04-07 22:02:52 +01:00
Daniele Varrazzo
04c09b7b38
Dropped GPL license from source
...
It doesn't apply: leaving the LGPL only.
2013-04-07 22:02:45 +01:00
Daniele Varrazzo
1af4bd83c4
Stop distributing the compiled documentation with the source
2013-04-07 22:02:38 +01:00
Daniele Varrazzo
af7347473e
Dropped stale entries from MANIFEST.in
2013-04-07 22:02:32 +01:00
Daniele Varrazzo
f2fbf18a05
Dropped psycopg 1 changelog
...
Also MANIFEST.in cleaned up from stale entries
2013-04-07 22:01:38 +01:00
Daniele Varrazzo
6d2f2676ad
Bump to next dev version
2013-04-07 19:43:52 +01:00
Daniele Varrazzo
80e105c74d
Merge branch 'devel'
2013-04-07 17:43:35 +01:00
Daniele Varrazzo
b448f822f4
Bump to release 2.5
2013-04-07 17:26:57 +01:00
Daniele Varrazzo
b214d10fff
Use NULL instead of an empty string as PyObject_CallMethod format
2013-04-07 17:26:57 +01:00
Daniele Varrazzo
884a7f7db6
A couple of typos fixed
2013-04-07 16:05:36 +01:00
Daniele Varrazzo
2b554937f2
Dropped __all__ from modules
...
They were only used to generate docs with Epydoc, now largely forgotten.
Imports in extras cleaned up to expose the API only.
2013-04-07 02:59:30 +01:00
Daniele Varrazzo
d5d6a1f4c7
Enable by default the range typecasters
...
Otherwise it would have been enabled importing psycopg2.extras,
which is a surprising behaviour.
2013-04-07 02:37:55 +01:00
Daniele Varrazzo
9e15f54fe8
Added cursor_factory connection attribute and connect() parameter
2013-04-07 02:30:12 +01:00
Daniele Varrazzo
0e06addc9f
Testing boilerplate unified in a single base class
...
The class makes a connection always available, allows creating
new connection and closes everything on tear down.
2013-04-07 00:23:30 +01:00
Daniele Varrazzo
408c76fdb6
Fixed build on windows
...
Will fail with error: initializer element is not constant
2013-04-06 01:34:12 +01:00
Daniele Varrazzo
d36024dc1f
Use the Python heap for conn->dsn
2013-04-06 00:42:25 +01:00
Daniele Varrazzo
c63d623f65
Merge branch 'drop-py24' into devel
2013-04-05 01:29:25 +01:00
Daniele Varrazzo
beea32ef03
Use the Py_RETURN_NONE macro
2013-04-05 01:25:05 +01:00
Daniele Varrazzo
67c8250081
Added tp_clear method for objects with GC support
2013-04-05 01:05:12 +01:00
Daniele Varrazzo
1a93279fe7
Dropped bogus return in void function
2013-04-05 01:03:05 +01:00
Daniele Varrazzo
e14440d96d
Dropped GC support for several objects
...
Non-containers don't need GC. It was half-baked anyway
as the tp_clear was often not set. Dropped tp_traverse too
for these objects as unused.
2013-04-05 01:02:47 +01:00
Daniele Varrazzo
95ff64d739
Dropped encoding attribute from list adapter
2013-04-05 00:35:02 +01:00
Daniele Varrazzo
6bc4b23af5
Static-type psycopg_escape_string connection parameter
2013-04-05 00:07:36 +01:00
Daniele Varrazzo
736a78f3f6
Avoid encoding strdup in qstring adapter
...
Dropped encoding parameter in the constructor: it is used
nowhere and not documented. Use directly the connection
encoding if available, else the previous latin1 fallback.
2013-04-05 00:00:42 +01:00
Daniele Varrazzo
7a5a226b49
Set a memory exception in psycopg_escape_string
...
...otherwise all the callers should set it.
2013-04-04 22:48:53 +01:00
Daniele Varrazzo
7328aaf0fb
Dropped GC support from Xid and Notify types
...
These types are immutable and have only atomic types attributes, so it's
impossible to build loops out of them.
2013-04-02 01:50:31 +01:00
Daniele Varrazzo
5aafe38fd7
Some improvements to connection/cursor GC
...
Provide a tp_clear, make sure that GC_UnTrack is called before clearing.
2013-03-21 12:55:17 +00:00
Daniele Varrazzo
3b8abf3fc4
Clean the C members of Error in tp_dealloc instead of tp_clear
...
tp_clear should only be used to break the reference cycles. tp_clear was
causing a segfault because it was called twice (by the gc and by _dealloc) so
self->codec was freed twice.
Amazingly the double free was only causing a segfault on Python 3.3 (released
in late 2012) talking to Postgres 8.1 (released in 2005) in async mode... no
other combination crashed. Thank you buildbot.
2013-03-21 12:34:53 +00:00
Daniele Varrazzo
d5316d7eb2
PyType_GenericAlloc is the default allocator: no need to specify
2013-03-20 23:53:20 +00:00
Daniele Varrazzo
eb280c1da4
Better use of Py_CLEAR and implicit zeroed-out structures
2013-03-20 23:53:20 +00:00
Daniele Varrazzo
546927d44a
Use wrap to fix names of decorated test methods
...
Decorators not using wrap() prevent running the test from command line, e.g.
with:
python tests/__init__.py test_module.TestSuite.test_method
2013-03-20 23:53:20 +00:00
Daniele Varrazzo
31265e3439
Fixed broken test decorator preventing 3 tests to run
2013-03-20 23:53:19 +00:00
Daniele Varrazzo
b6873ee1ab
Dropped support for Python 2.4
2013-03-20 23:40:13 +00:00
Daniele Varrazzo
e65392e0d8
PyType_GenericAlloc is the default allocator: no need to specify
2013-03-20 22:59:50 +00:00
Daniele Varrazzo
8a59e75d62
Better use of Py_CLEAR and implicit zeroed-out structures
2013-03-20 22:59:50 +00:00
Daniele Varrazzo
09629a6dbc
Use wrap to fix names of decorated test methods
...
Decorators not using wrap() prevent running the test from command line, e.g.
with:
python tests/__init__.py test_module.TestSuite.test_method
2013-03-20 17:26:10 +00:00
Daniele Varrazzo
0c0e2a2455
Fixed broken test decorator preventing 3 tests to run
2013-03-20 17:13:33 +00:00
Daniele Varrazzo
3410fee8d1
Fixed leak of cancel key on connection.reset()
...
Moving the final free into the destructor is not necessary but looks
appropriate.
2013-03-20 16:43:16 +00:00
Daniele Varrazzo
9813bac4fe
Added forgotten attributes to visit in error
2013-03-20 15:06:06 +00:00
Daniele Varrazzo
75811f5bb1
Note than Python 3.3 is supported in install docs
2013-03-20 13:08:01 +00:00
Daniele Varrazzo
87962728ee
Fixed ticket number in NEWS file
2013-03-20 11:42:15 +00:00
Daniele Varrazzo
5dfba462da
Dropped "customized" pg_free functions
...
The defaut is already to call PyObject_GC_Del.
2013-03-20 01:48:21 +00:00
Daniele Varrazzo
0830deb790
Dropped IFCLEARPGRES macro
...
PQclear already guards against NULL, so the extra check is redundant
2013-03-20 01:48:17 +00:00
Daniele Varrazzo
16021dae6d
Use Py_CLEAR on self->query instead of if and decref
2013-03-20 01:48:11 +00:00
Daniele Varrazzo
a210859326
Notify and Xid objects and types renamed for consistency
...
They were the only objects starting with uppercase. My fault.
2013-03-20 01:48:05 +00:00
Daniele Varrazzo
73949cd1b8
Merge branch 'diagnostics' into devel
2013-03-20 01:47:14 +00:00
Daniele Varrazzo
b503db9ce6
psycopg2.Error object and type renamed more consistently
2013-03-20 00:03:58 +00:00
Daniele Varrazzo
114c62fac8
Added tests to verify the new Diagnostics properties
...
diag can be used on exceptions raised without cursor and is independent from
the cursor.
Docs updated to reflect the changes.
2013-03-20 00:03:58 +00:00
Daniele Varrazzo
7177f815a6
Store a PGresult in the Exception error
...
This makes the Diagnostics independent from further operations on the cursor
and allows using it with exceptions not generated by a cursor.
2013-03-19 23:42:54 +00:00
Daniele Varrazzo
394312939e
Added a C structure to psycopg.Error
...
This will allow to store a PGresult in it.
2013-03-19 12:15:49 +00:00
Daniele Varrazzo
e86efa7e30
Added summary data types conversion table to the docs
...
It allows looking at a glance both basic and extended type casters,
with plenty of links to the detailed explanations.
2013-03-18 19:22:31 +00:00
Daniele Varrazzo
abb3027aa3
NEWS file reformatted to reST and included in the docs
2013-03-18 15:42:10 +00:00
Daniele Varrazzo
93928a7141
Document that errorcodes is updated to 9.2
2013-03-18 15:10:24 +00:00
Daniele Varrazzo
ae918c34b8
Copyright year bumped to 2013 in docs footer
2013-03-18 15:10:06 +00:00
Daniele Varrazzo
294e7ae080
Tests tweaked to run on all the supported versions
2013-03-18 10:06:07 +00:00
Daniele Varrazzo
97311967e8
Merge branch 'diagnostics' into devel
2013-03-18 02:21:09 +00:00
Daniele Varrazzo
fe6eb127fc
Fixed bad interaction of setup.py with other dependencies
...
The problem is in Distribute dependencies on Python 3. Create a new command
class instead of changing inplace the one other projects may use.
Close ticket #153 .
2013-03-18 02:18:50 +00:00
Daniele Varrazzo
49c3569919
Diagnostics added to the NEWS file
2013-03-18 02:11:45 +00:00
Daniele Varrazzo
1cf9825035
Diagnostics is more GC friendly
2013-03-18 02:11:45 +00:00
Daniele Varrazzo
678f0dc949
Added documentation about the Diagnostics object
2013-03-18 02:11:45 +00:00
Daniele Varrazzo
819a551d01
Decode Diagnostics result on Python 3
2013-03-18 00:38:28 +00:00
Daniele Varrazzo
70b756b8c7
Added test to verify Diagnostics works after copy errors
2013-03-18 00:31:25 +00:00
Daniele Varrazzo
660386929f
Added test to verify Diagnostics reference disposal
2013-03-18 00:24:46 +00:00
Daniele Varrazzo
42b063b562
Added all supported properties to the Diagnostic object
2013-03-17 23:58:10 +00:00
Daniele Varrazzo
9e79112e25
Expose the Diagnostics object in the extensions module
2013-03-17 23:58:10 +00:00
Matthew Woodcraft
c75a3bbab4
Work-in-progress support for retrieving PG_DIAG result error fields.
2013-03-17 16:41:15 +00:00
Daniele Varrazzo
06bfa801f4
Fixed range adaptation on Python 3
2013-03-16 22:12:41 +00:00
Daniele Varrazzo
af18c29f0b
Fixed exception handling in disconnection test
...
OperationalError is DatabaseError's subclass.
2013-03-16 21:43:11 +00:00
Daniele Varrazzo
c5de7b5ac6
Fixed Decimal range tests
2013-03-16 17:58:58 +00:00
Daniele Varrazzo
594a4d79ec
Fixed handling of database disconnection in tests in green mode
2013-03-16 17:41:59 +00:00
Daniele Varrazzo
e1ff432f4c
Merge branch 'dead-bytes' into devel
2013-03-16 16:25:17 +00:00
Daniele Varrazzo
4883ce7d91
Added ZPsycopgDA URL to the NEWS file
2013-03-16 16:23:02 +00:00
Daniele Varrazzo
66d6c68dcc
Properly cleanup memory of broken connections
...
Fixed ticket #148 .
2013-03-16 11:56:38 +00:00
Catalin Iacob
7abe1775d0
Fix tests for Postgres 9.3
...
Postgres 9.3 turns messages about implicit indexes and sequences from NOTICE
to DEBUG1 so the tests fail with a default 9.3 server configuration because
the client doesn't get any NOTICE. Fix it by also asking for DEBUG1 messages
from the server when testing against Postgres >= 9.3.
2013-03-16 00:54:11 +00:00
Idan Kamara
7f86529183
docs: grammar fix in extras.rst
2013-03-06 11:36:32 +02:00
Daniele Varrazzo
7a1d1791d3
Merge commit '2_4_6'
2013-01-21 11:18:27 +00:00
Daniele Varrazzo
e8db9954d1
Improvements to the connect() docs
...
- links updated to the current PG docs, which include the syntax as url
and lists the parameters in a separate chapter
- more evident links to the PG docs
- mutually exclusive use of dsn and **kwargs specified
See ticket #143
2013-01-09 12:56:06 +00:00
Daniele Varrazzo
49af4fe539
Fixed interactive sessions docs examples
2013-01-09 03:10:32 +00:00
Daniele Varrazzo
16d96fd43c
Merge branch 'py33' into devel
2012-12-22 00:58:17 +01:00
Daniele Varrazzo
cedd15cb49
Python 3.3 is now supported
2012-12-22 00:56:48 +01:00
Daniele Varrazzo
a04379210b
Doubt about 'c' buffer solved by Stefan Krah
2012-12-22 00:51:47 +01:00
Daniele Varrazzo
4e65ca1d8d
Version bumped to 2.4.6
2012-12-11 01:40:02 +00:00
Daniele Varrazzo
67445dfbea
Fixed pickling of DictRow objects too
2012-12-11 01:40:02 +00:00
Daniele Varrazzo
5bee4d3379
Fixed pickling of RealDictRow objects
2012-12-11 01:40:02 +00:00
Daniele Varrazzo
6df6e6adfe
Fixed pickling of DictRow objects too
2012-12-11 01:10:45 +00:00
Daniele Varrazzo
99bedd1bb2
Fixed pickling of RealDictRow objects
2012-12-10 23:54:25 +00:00
Daniele Varrazzo
e6fbf47c46
Merge branch 'contextmanager' into devel
2012-12-04 00:38:01 +00:00
Daniele Varrazzo
ec34b9bed6
Mention context managers in NEWS file
2012-12-04 00:37:49 +00:00
Daniele Varrazzo
170636d46d
Merge branch 'zope-fixes' into devel
2012-12-04 00:34:48 +00:00
Daniele Varrazzo
bb72f121fb
Fixed connections re-init across ZSQL methods
...
Fixes issue #142 , probably #123 and #125 too.
2012-12-04 00:31:22 +00:00
Daniele Varrazzo
27cd6c4880
Added specific pool implementation for ZPsycopgDA
...
The implementation is based on psycopg 2.4, which should be less broken
(zope-wise) of the current one.
Instantiating psycopg2.pool.PersistentConnectionPool now raises a warning.
This should fix ticket #123 , #125 . The issue of the reset on
set_client_encoding() is still present but that's always been there and I'm no
good at fixing it.
2012-12-04 00:30:58 +00:00
Daniele Varrazzo
57e1631181
Use set_session instead of set_isolation_level where available
...
Avoid spurious queries as reported in psycopg2 ticket #125 .
2012-12-04 00:30:52 +00:00
Daniele Varrazzo
f1a8c075ab
Show all the available isolation levels in ZPsycopgDA menu
2012-12-04 00:30:48 +00:00
Daniele Varrazzo
6e57f32f8d
Added 2.4.6 to the allowed versions for ZPsycopgDA
...
Dropped beta versions and the versions with the messed up isolation level
constants.
2012-12-04 00:30:43 +00:00
Daniele Varrazzo
a64fd31fd1
Fixed connections re-init across ZSQL methods
...
Fixes issue #142 , probably #123 and #125 too.
2012-12-03 16:49:55 +00:00
Daniele Varrazzo
5053a7c2b6
Fixed version number in NEWS file
2012-12-03 14:22:04 +00:00
Daniele Varrazzo
0653861bc4
Fixed empty strings handling in composite caster
...
Closes ticket #141 .
2012-12-03 14:20:08 +00:00
Daniele Varrazzo
9a031db8b9
Fixed empty strings handling in composite caster
...
Closes ticket #141 .
2012-12-03 14:19:09 +00:00
Daniele Varrazzo
12645db754
Make sure to call subclasses methods on context exit
2012-12-03 03:37:47 +00:00
Daniele Varrazzo
c2f284cd3b
Added documentation for the with statement
2012-12-03 03:18:51 +00:00
Daniele Varrazzo
8e08aeb690
Dropped Zope support
2012-12-03 02:53:20 +00:00
Daniele Varrazzo
cc605032f5
Added support for with statement for connection and cursor
...
The implementation should be conform to the DBAPI, although the "with"
extension has not been released yet.
2012-12-03 02:50:24 +00:00
Daniele Varrazzo
9f06df1820
Fixed signature for METH_NOARGS functions
2012-12-03 02:49:06 +00:00
Daniele Varrazzo
dcbbaa76d6
Dropped unmaintained changelog
...
Welcome to the worderful world of SCM.
2012-12-03 00:39:47 +00:00
Daniele Varrazzo
2a9e5c7203
Dropped configuration of unused logger inside the pool module
2012-12-03 00:39:47 +00:00
Daniele Varrazzo
d74aea209b
Dropped debian package metadata
...
This is being maintained ouside psycopg2 source tree:
http://anonscm.debian.org/viewvc/python-modules/packages/psycopg2/trunk/
and the copy in our tree is out of date.
2012-12-03 00:39:47 +00:00
Daniele Varrazzo
02ffb7423a
Splitting the release of new features in version 2.5
2012-12-03 00:39:19 +00:00
Daniele Varrazzo
bf45539585
Added specific pool implementation for ZPsycopgDA
...
The implementation is based on psycopg 2.4, which should be less broken
(zope-wise) of the current one.
Instantiating psycopg2.pool.PersistentConnectionPool now raises a warning.
This should fix ticket #123 , #125 . The issue of the reset on
set_client_encoding() is still present but that's always been there and I'm no
good at fixing it.
2012-12-03 00:37:02 +00:00
Daniele Varrazzo
fb24777200
Use set_session instead of set_isolation_level where available
...
Avoid spurious queries as reported in psycopg2 ticket #125 .
2012-12-02 23:51:26 +00:00
Daniele Varrazzo
f9bcbc213e
Show all the available isolation levels in ZPsycopgDA menu
2012-12-02 23:27:21 +00:00
Daniele Varrazzo
6fb0b001b2
Added 2.4.6 to the allowed versions for ZPsycopgDA
...
Dropped beta versions and the versions with the messed up isolation level
constants.
2012-12-02 22:46:55 +00:00
Daniele Varrazzo
f6054c28d8
Release the GIL around PQgetResult calls after COPY
...
It should fix ticket #140 .
2012-11-24 22:51:23 +00:00
Daniele Varrazzo
362c2ae597
Release the GIL around PQgetResult calls after COPY
...
It should fix ticket #140 .
2012-11-24 22:49:36 +00:00
Daniele Varrazzo
896ad7c827
Fixed a couple of terms in the docs
...
After Pierre-Louis Bonicoli's suggestions in ticket #138 .
2012-11-12 01:32:38 +00:00
Daniele Varrazzo
10476200fd
Added note about the adapted attribute in the module-level wrappers
...
Specifying it otherwise people expects the wrappers to have full datetime
semantics: see ticket #136 .
2012-10-27 22:24:48 +01:00
Daniele Varrazzo
0837fc958e
Merge branch 'fix-135' into maint_2_4
2012-10-21 22:02:39 +01:00
Daniele Varrazzo
e109024d39
Merge branch 'fix-135' into devel
2012-10-21 21:49:30 +01:00
Daniele Varrazzo
5e6eabd9f8
Fixed pickling of FixedOffsetTimezone objects
...
I have also verified that the fixed class can unpickle instance pickled with
the buggy one and viceversa.
Fixes ticket #135 .
2012-10-21 21:47:32 +01:00
Daniele Varrazzo
1feb179fba
Fixed pickling of FixedOffsetTimezone objects
...
I have also verified that the fixed class can unpickle instance pickled with
the buggy one and viceversa.
Fixes ticket #135 .
2012-10-21 21:47:32 +01:00
Daniele Varrazzo
790843a48a
More idiomatic way to call FixedOffsetTimezone.__new__ superclass
2012-10-21 21:16:52 +01:00
Daniele Varrazzo
a33c0670fd
More idiomatic way to call FixedOffsetTimezone.__new__ superclass
2012-10-21 21:16:52 +01:00
Daniele Varrazzo
e4a07c3a30
Dropped redundant call to FixedOffsetTimezone.__init__
2012-10-21 21:12:02 +01:00
Daniele Varrazzo
f5f2e2c092
Dropped redundant call to FixedOffsetTimezone.__init__
2012-10-21 21:12:02 +01:00
Daniele Varrazzo
6b8861d2d5
Clarification in copy_expert docs
...
Closes ticket #134 .
2012-10-15 00:47:22 +01:00
Daniele Varrazzo
71393b9ae9
Discard any result produced by cursor.executemany()
2012-10-11 22:29:03 +01:00
Daniele Varrazzo
4ddad45feb
Discard any result produced by cursor.executemany()
2012-10-11 22:27:35 +01:00
Daniele Varrazzo
5fbf3ef147
Merge branch 'fix-113' into devel
2012-10-11 22:26:51 +01:00
Daniele Varrazzo
20d3344972
Merge branch 'fix-113' into maint_2_4
2012-10-09 02:02:28 +01:00
Daniele Varrazzo
58d048198f
Close the connection on error in callback
...
Unfortunately PQcancel blocks, so it's not better than PQgetResult.
It has been suggested to use PQreset in non-blocking way but this would give
the Python program the burden of handling a connection done but not configured
in an unexpected place.
2012-10-09 02:01:29 +01:00
Daniele Varrazzo
7632e1ae46
Get the result from the connection after the green panic
...
Otherwise the connection won't be usable in case we manage
to put it back on track (libpq reports "another command is
already in progress")
2012-10-09 02:01:29 +01:00
Daniele Varrazzo
6b6aded90b
Added compatibility PyErr_WarnEx macro for Python 2.4
2012-10-09 02:01:29 +01:00
Daniele Varrazzo
fa032f09fb
Attempt to fix issue #113 .
...
If the network is down, trying to read blocking will hang the process hard
(ctrl-c not working). Send a cancel signal instead (as suggested in
http://archives.postgresql.org/pgsql-hackers/2012-07/msg00903.php ) and go
back into a green polling: this should allow a further error (e.g. another
ctrl-c) to break the loop. In this case we cannot assume anything about
the state of the connection, so we close it.
2012-10-09 02:01:29 +01:00
Daniele Varrazzo
6d1b3b21e6
Added function conn_close_locked()
2012-10-09 02:01:29 +01:00
Daniele Varrazzo
ee763e0f47
Copyright bumped to 2012 in docs pages
2012-10-07 13:14:31 +01:00
Daniele Varrazzo
a666432329
Docs front page adjustments
2012-10-07 02:07:47 +01:00
Daniele Varrazzo
82dc32cebd
Added install section to the manual
2012-10-07 02:04:39 +01:00
Daniele Varrazzo
b61a2a34c4
Close the connection on error in callback
...
Unfortunately PQcancel blocks, so it's not better than PQgetResult.
It has been suggested to use PQreset in non-blocking way but this would give
the Python program the burden of handling a connection done but not configured
in an unexpected place.
2012-10-06 11:58:52 +01:00
Daniele Varrazzo
2611d62283
Get the result from the connection after the green panic
...
Otherwise the connection won't be usable in case we manage
to put it back on track (libpq reports "another command is
already in progress")
2012-10-06 01:45:24 +01:00
Daniele Varrazzo
f4f67ad985
Dropped compiler warning on Py 2.4
2012-10-06 01:22:05 +01:00
Daniele Varrazzo
644b18a2c9
Dropped compiler warning on Py 2.4
2012-10-06 01:22:05 +01:00
Daniele Varrazzo
76815f1e92
Added compatibility PyErr_WarnEx macro for Python 2.4
2012-10-06 01:16:57 +01:00
Daniele Varrazzo
53b1c70f3a
Attempt to fix issue #113 .
...
If the network is down, trying to read blocking will hang the process hard
(ctrl-c not working). Send a cancel signal instead (as suggested in
http://archives.postgresql.org/pgsql-hackers/2012-07/msg00903.php ) and go
back into a green polling: this should allow a further error (e.g. another
ctrl-c) to break the loop. In this case we cannot assume anything about
the state of the connection, so we close it.
2012-10-06 01:10:41 +01:00
Daniele Varrazzo
2137db89d4
Added function conn_close_locked()
2012-10-06 01:03:12 +01:00
Daniele Varrazzo
387b7b6b36
Using super() in the connection/cursor subclasses
...
This opens to collaborative subclassing (e.g. you may want to have a
logging namedtuple cursor...)
2012-09-28 02:51:58 +01:00
Daniele Varrazzo
9f9da182f1
Using super() in the connection/cursor subclasses
...
This opens to collaborative subclassing (e.g. you may want to have a
logging namedtuple cursor...)
2012-09-28 02:51:58 +01:00
Daniele Varrazzo
4244d5953a
Merge branch 'range-type' into devel
2012-09-27 00:48:05 +01:00
Daniele Varrazzo
dda24f082f
Merge branch 'json' into devel
2012-09-27 00:41:04 +01:00
Daniele Varrazzo
465b5cf280
Mention JSON adaptation in the NEWS file
2012-09-27 00:40:35 +01:00
Daniele Varrazzo
33043cd038
Merge branch 'composite-custom' into devel
2012-09-27 00:38:00 +01:00
Daniele Varrazzo
bc1d2f5d3a
Merge remote-tracking branch 'github/connect-keywords' into devel
2012-09-26 13:15:33 +01:00
Daniele Varrazzo
74e6efd717
Raise TypeError instead of InterfaceError on bad params on connect()
...
TypeError is the standard Python error raised in this case:
$ python -c "(lambda a: None)(b=10)"
TypeError: <lambda>() got an unexpected keyword argument 'b'
We only used to raise InterfaceError when connect was used without
any parameter at all, so it's hard to think a program depending on
that design. Furthermore the function has always raised (and still
does) OperationalError too, if the bad argument is detected by the
libpq, and that cannot be changed because we can't tell the
difference from a normal connection error.
2012-09-26 11:55:21 +01:00
Daniele Varrazzo
20d3d0f66d
Raise TypeError instead of InterfaceError on bad params on connect()
...
TypeError is the standard Python error raised in this case:
$ python -c "(lambda a: None)(b=10)"
TypeError: <lambda>() got an unexpected keyword argument 'b'
We only used to raise InterfaceError when connect was used without
any parameter at all, so it's hard to think a program depending on
that design. Furthermore the function has always raised (and still
does) OperationalError too, if the bad argument is detected by the
libpq, and that cannot be changed because we can't tell the
difference from a normal connection error.
2012-09-26 11:55:21 +01:00
Daniele Varrazzo
bc68b2ff1e
Improved error message on connect when kwargs are passed together with dns
2012-09-26 11:47:06 +01:00
Daniele Varrazzo
cf3c6f86ff
Improved error message on connect when kwargs are passed together with dns
2012-09-26 11:47:06 +01:00
Daniele Varrazzo
32fae728b3
Dropped quirks in connection arguments handling
...
Now connect() raises an exception instead of swallowing keyword arguments
when a connection string is specified as well
Closes ticket #131 .
2012-09-25 23:46:46 +01:00
Daniele Varrazzo
cd316a94f1
Dropped quirks in connection arguments handling
...
Now connect() raises an exception instead of swallowing keyword arguments
when a connection string is specified as well
Closes ticket #131 .
2012-09-25 23:46:46 +01:00
Daniele Varrazzo
b894539007
Fixed json doc error
2012-09-25 00:12:57 +01:00
Daniele Varrazzo
b8b669611e
More helpful error messasge on Range order attempts
2012-09-25 00:07:08 +01:00
Daniele Varrazzo
7b1973354f
Fixed SQL_IN when getquoted() is called without prepare()
2012-09-24 16:55:01 +01:00
Daniele Varrazzo
a733416241
Fixed SQL_IN when getquoted() is called without prepare()
2012-09-24 16:55:01 +01:00
Daniele Varrazzo
f70e6a1519
Grammar correction for RangeCaster.array_typecaster
2012-09-24 12:13:46 +01:00
Daniele Varrazzo
71e2f190c2
Json documentation improved
2012-09-24 11:51:35 +01:00
Daniele Varrazzo
a3418052e9
Don't create/register a json array typecaster if no oid provided
2012-09-24 11:23:09 +01:00
Daniele Varrazzo
c756d580f2
Added documentation for range types and adaptation
2012-09-24 00:49:44 +01:00
Daniele Varrazzo
b1953640d2
Don't need to implement __new__ to make an immutable class
2012-09-24 00:49:02 +01:00
Daniele Varrazzo
a858987844
Fixed search of types into schemas.
...
We don't need to look for stuff implicitly into pg_catalog as all
the builtin ranges are already registered. So just search into
'public' if the schema is not specified.
2012-09-24 00:49:02 +01:00
Daniele Varrazzo
a1a2772a79
Added test for range not found
2012-09-24 00:48:56 +01:00
Daniele Varrazzo
a701e36d16
Added containment tests for unbounded intervals
2012-09-23 22:59:49 +01:00
Daniele Varrazzo
841ddaba87
Range objects cannot be ordered
2012-09-23 22:54:50 +01:00
Daniele Varrazzo
25ef540aa3
Range objects are nonzero when not empty
2012-09-23 22:43:23 +01:00
Daniele Varrazzo
a96a4349ed
Range objects are immutable and hashable
2012-09-23 22:40:13 +01:00
Daniele Varrazzo
e002ea5937
Dropped Range._empty attribute
...
We can do with just _bounds: it will make eq and hash easier to
implement in a consistent way
2012-09-23 22:10:33 +01:00
Daniele Varrazzo
d2cee6f9ad
Added in operator for ranges
2012-09-23 22:01:39 +01:00
Daniele Varrazzo
94c6353d55
NumberRange renamed to NumericRange
...
I was avoiding Numeric to avoid conflicting with the 'numeric'
Postgres type, which is an alias for 'decimal'. But now that there
is a single numeric range I can use the preferred name
2012-09-23 21:11:06 +01:00
Daniele Varrazzo
45cbcc0713
Dropped Range classes for specific numeric types
2012-09-23 21:08:18 +01:00
Daniele Varrazzo
5e7c1d0b51
Added first implementation of Range type, adapter, typecaster
2012-09-23 21:03:36 +01:00
Daniele Varrazzo
9949e04c70
Added schema attribute to CompositeCaster
2012-09-22 15:10:40 +01:00
Daniele Varrazzo
59151886a0
Info about hstore versions history moved from code to docs
2012-09-22 02:10:58 +01:00
Daniele Varrazzo
d183657c11
Info about hstore versions history moved from code to docs
2012-09-22 02:10:58 +01:00
Daniele Varrazzo
26cfdc1234
Info about versions history moved from code to docs
2012-09-22 02:08:21 +01:00
Daniele Varrazzo
fa9393b587
Added documentation about CompositeCaster subclassing
2012-09-22 02:01:04 +01:00
Daniele Varrazzo
1b2c2c34b6
Make CompositeCaster easier to subclass
2012-09-22 01:46:53 +01:00
Daniele Varrazzo
6d9a25e63a
Deal with sys.platform = "linux"
...
Changed in Python 3.3.
2012-09-21 02:28:52 +01:00
Daniele Varrazzo
7de8611607
errorcodes map updated to PostgreSQL 9.2
2012-09-21 01:59:02 +01:00
Daniele Varrazzo
469b6f8aff
Return memoryview object of type "c" instead of "B" from bytea
...
In Python 3.3 items are returned as int instead of chars.
I'm not sure the way I did it is correct: worth asking some
hardcore Python dev.
Fixed tests after the stricter memview comparison rules in Py 3.3.
2012-09-21 00:54:37 +01:00
Daniele Varrazzo
526e270934
Use namedtuple._make in NamedTupleCursor and CompositeCaster
...
Makes things more natural as _make has the same signature of the tuple (see
_ctor in CompositeCaster) and is probably more efficient with less
intermediate sequences to build.
2012-09-20 16:27:50 +01:00
Daniele Varrazzo
5645e7adef
Pasto fixed
2012-09-20 03:44:50 +01:00
Daniele Varrazzo
abe2df5f57
Merge branch 'fix-array-parsing' into devel
2012-09-20 03:26:07 +01:00
Daniele Varrazzo
62a54f64f7
Fixed infinite loop when parsing '{' as array
2012-09-20 03:24:47 +01:00
Daniele Varrazzo
0e644f6d95
Fixed return value after malformed arrays
2012-09-20 03:24:26 +01:00
Daniele Varrazzo
c7bee92160
Fixed infinite loop when parsing '{' as array
2012-09-20 03:19:24 +01:00
Daniele Varrazzo
9b2ad7abb5
Fixed json typecaster with NULL input
2012-09-20 00:39:34 +01:00
Daniele Varrazzo
7386b8327c
Dropped keywords passthrough in Json adapter
...
Pass a dumps function instead. Allow customizing by either arg passing or
subclassing.
The basic Json class now raises ImportError on getquoted() if json is not
available, thus allowing using a customized Json subclass even when the json
module is not available.
2012-09-19 16:32:57 +01:00
Daniele Varrazzo
d963b478e2
Added register_default_json() function
...
Register a typecaster for PostgreSQL 9.2 json.
2012-09-19 15:49:00 +01:00
Daniele Varrazzo
26d71b4cba
First parameter of register_json defaults to None
2012-09-19 15:31:28 +01:00
Daniele Varrazzo
024f0dbada
Added json typecaster
2012-09-19 04:26:35 +01:00
Daniele Varrazzo
b8e7f02256
Added Json adapter
2012-09-19 04:12:20 +01:00
Daniele Varrazzo
64e3e1199e
Fixed note on rollback on close in the doc
...
It's not like we call "rollback()": we close the connection and the
backend rolls back on its own. It may have differences, e.g. conn poolers.
2012-09-18 12:54:41 +01:00
Daniele Varrazzo
9ae4bbd195
Fixed smell of pizza in the docs
2012-09-18 12:54:41 +01:00
Daniele Varrazzo
72e9cf7b6d
Fixed return value after malformed arrays
2012-09-10 04:20:39 +01:00
Daniele Varrazzo
5fedaa5474
Fixed tests to run with PG 8.3
2012-09-04 21:23:19 +01:00
Federico Di Gregorio
40a512fe46
Fixed always true comparaison
2012-08-17 14:52:59 +02:00
Daniele Varrazzo
fc5cc1df01
Fixed note on rollback on close in the doc
...
It's not like we call "rollback()": we close the connection and the
backend rolls back on its own. It may have differences, e.g. conn poolers.
2012-08-15 12:28:13 +01:00
Daniele Varrazzo
7cb754fbc9
Fixed smell of pizza in the docs
2012-08-15 12:25:35 +01:00
Daniele Varrazzo
bc400f6961
Fixed tests to run with PG 8.3
2012-09-04 21:23:19 +01:00
Federico Di Gregorio
64674787fd
Fixed always true comparaison
2012-08-17 14:52:59 +02:00
Daniele Varrazzo
07e2c6a62f
Merge branch 'scrollable' into devel
2012-08-15 11:27:43 +01:00
Daniele Varrazzo
99b7683338
Added documentation for scrollable cursors
2012-08-15 11:26:45 +01:00
Daniele Varrazzo
a79a5292e7
Added support with cursors without scroll clause
...
Using nothing is different from NO SCROLL, see DECLARE notes
in PG docs.
2012-08-15 09:44:44 +01:00
Daniele Varrazzo
d074b096be
Added test for scrollable cursor
2012-08-15 01:11:26 +01:00
Daniele Varrazzo
fa4994e471
Added scrollable cursor implementation
...
Patch provided by Jon Nelson (ticket #108 ).
2012-08-15 00:30:54 +01:00
Daniele Varrazzo
cc951b5fbe
Fixed tpc_recover() with RealDictStuff
...
Same problem and correction of ticket #114 .
2012-08-14 23:29:19 +01:00
Daniele Varrazzo
91c2ff9296
Fixed tpc_recover() with RealDictStuff
...
Same problem and correction of ticket #114 .
2012-08-14 23:29:19 +01:00
Daniele Varrazzo
fd4153d632
Fixed register_hstore and register_composite with non-dbapi objects
...
Closed ticket #114 .
2012-08-14 23:26:17 +01:00
Daniele Varrazzo
21d323d2c8
Fixed register_hstore and register_composite with non-dbapi objects
...
Closed ticket #114 .
2012-08-14 23:26:17 +01:00
Daniele Varrazzo
e369fb5f0d
Fixed incorrect and outdated connection.commit() doc
2012-07-27 17:44:28 +01:00
Daniele Varrazzo
8666693512
Fixed incorrect and outdated connection.commit() doc
2012-07-27 17:44:28 +01:00
Brian Sutherland
2371166383
grammar
2012-07-27 12:48:28 +03:00
Daniele Varrazzo
ee7890d700
Fixed typo in docs
...
Ticket #115 closed.
2012-07-08 22:52:24 +01:00
Daniele Varrazzo
3559ea0d10
Fixed typo in docs
...
Ticket #115 closed.
2012-07-08 22:52:24 +01:00
Daniele Varrazzo
f9a13eb563
connection.reset() implemented using DISCARD ALL
2012-06-25 16:37:11 +01:00
Federico Di Gregorio
7a33ebd580
Merge remote-tracking branch 'msabramo/travis' into devel
...
Travis CI (http://travis-ci.org/ ) is a hosted CI system
"in the cloud".
2012-06-18 12:24:21 +02:00
Federico Di Gregorio
79165dab78
Merge remote-tracking branch 'msabramo/tox' into devel
...
Tox (http://tox.testrun.org/ ) is a nice tool for
testing a package against multiple Python distributions.
2012-06-18 12:23:44 +02:00
Marc Abramowitz
6bf2b1b465
Add .travis.yml for Travis CI ( http://travis-ci.org/ )
2012-06-15 08:07:19 -07:00
Marc Abramowitz
3c510cf768
Add .tox to .gitignore
2012-06-15 02:57:11 -07:00
Marc Abramowitz
9e1e69003b
Add tox.ini for tox ( http://tox.testrun.org/ )
2012-06-15 02:56:44 -07:00
Daniele Varrazzo
ea203f0587
Added %% use to the docs
2012-05-29 23:53:02 +01:00
Daniele Varrazzo
08c8b62e1b
Added %% use to the docs
2012-05-29 23:53:02 +01:00
Daniele Varrazzo
c7d1271ab4
Fixed cursor name as unicode string on Python 3
2012-05-27 08:58:55 +01:00
Daniele Varrazzo
e8fb84306d
Fixed cursor name as unicode string on Python 3
2012-05-27 08:58:55 +01:00
Daniele Varrazzo
cb6baff8e0
Dropped build dirs entries from setup.cfg
...
They were not used anymore after pg_config had become mandatory to build the
module. Thanks to Steven Winfield for the report (ticket #109 ).
2012-05-23 11:02:05 +01:00
Daniele Varrazzo
874a74fe94
Dropped GIL release around function calling PyMem_Malloc
...
Closes ticket #110 .
2012-05-22 17:22:57 +01:00
Daniele Varrazzo
7982a6ac0b
Dropped GIL release around function calling PyMem_Malloc
...
Closes ticket #110 .
2012-05-22 17:22:57 +01:00
Daniele Varrazzo
ba1fe6fff6
Fixed superclass methods call.
...
Methods execute() and callproc() in DictCursor and RealDictCursor should
call DictCursorBase methods, not _cursor's ones.
Reported by Alexey Luchko on the ML.
2012-05-08 15:48:07 +01:00
Daniele Varrazzo
55828c2ea3
Fixed superclass methods call.
...
Methods execute() and callproc() in DictCursor and RealDictCursor should
call DictCursorBase methods, not _cursor's ones.
Reported by Alexey Luchko on the ML.
2012-05-08 15:48:07 +01:00
Daniele Varrazzo
291b4ce81f
Fixed text docs build on Python 3
...
Thanks to Arfrever for the patch (ticket #107 ).
2012-04-11 18:18:40 +01:00
Daniele Varrazzo
667387e746
Fixed text docs build on Python 3
...
Thanks to Arfrever for the patch (ticket #107 ).
2012-04-11 18:18:40 +01:00
Daniele Varrazzo
4436fce4c6
Merge branch 'cursor-args-fix' into devel
2012-04-11 18:12:27 +01:00
Daniele Varrazzo
47336c7428
Merge branch 'cursor-args-fix' into MAINT_2_4
2012-04-11 18:12:27 +01:00
Daniele Varrazzo
241403e7ba
Bump to next dev release
2012-04-11 18:11:59 +01:00
Daniele Varrazzo
210eeb875d
Bump to next dev release
2012-04-11 18:11:59 +01:00
Daniele Varrazzo
73df259f7b
Added news entry about cursor() cleanup
2012-04-11 18:11:04 +01:00
Daniele Varrazzo
365a1b20a7
Added tests to verify cursor() arguments propagation
2012-04-11 18:00:18 +01:00
Daniele Varrazzo
c86ca7687f
Fixed cursor() arguments propagation to other connection classes
2012-04-11 17:59:16 +01:00
Corry Haines
095cce5605
Allow user to override connection factory cursors
...
Prior to this change, using a extras.connection_factory would not allow
any other cursor to be used on that connection. It was set in stone.
This change allows all cursor options to pass through and override the
connection factory behaviors. This allows a connection_factory to be
dropped into existing code with no disruption.
This change also standardizes the extras.connection_factories to have
the same behavior and all pass through *args and **kwargs.
2012-04-11 17:36:04 +01:00
Daniele Varrazzo
27421f1e41
Name can be passed as None to cursor()
...
Makes invocation from subclasses and generic code easier.
Code simplified by using default values for keyword arguments
and avoiding needless conversions back and forth between Python and C
strings. Also added connection type check to cursor's init.
2012-04-11 17:32:10 +01:00
Daniele Varrazzo
c63891af8d
Fixed bad error return code from cursor's init
2012-04-11 17:26:11 +01:00
Federico Di Gregorio
d7c8c1c49a
Merge branch 'devel'
2012-03-28 23:09:15 +02:00
Federico Di Gregorio
037b704e9a
Bumping up versions to prepare 2.4.5
2012-03-28 23:08:59 +02:00
Daniele Varrazzo
67064f8e03
All the FAQ have they own id that can be used in URLs to refer to
2012-03-09 16:55:02 +00:00
Daniele Varrazzo
5473d50a09
Added more information about the case of the missing lo_truncate
...
After some ML message and ticket #104 .
2012-03-09 16:55:02 +00:00
Federico Di Gregorio
550130b19e
Merge remote-tracking branch 'piro/devel' into devel
...
Conflicts:
psycopg/lobject_int.c
2012-03-08 12:28:52 +01:00
Daniele Varrazzo
b8c75d9de0
Merge branch 'gcc-python-plugin' into devel
2012-03-05 02:48:11 +00:00
Daniele Varrazzo
37aa62ca52
Merge branch 'close-idempotent' into devel
2012-03-05 02:47:52 +00:00
Daniele Varrazzo
2c309dfdb4
Mention the static analysis cleanup in the news
2012-03-05 02:38:21 +00:00
Daniele Varrazzo
8707d8c399
Fixed iterator refcount in case of memory error during COPY
2012-03-05 02:09:20 +00:00
Daniele Varrazzo
735d50c782
Check if the object wrapped in binary is not None before trying the other types
...
Otherwise it seems we clobber some result with NULL.
2012-03-05 02:08:45 +00:00
Daniele Varrazzo
a9dc1b83ad
Methods callbacks signatures match the flags they are exported with
2012-03-05 01:26:28 +00:00
Daniele Varrazzo
531084d561
Stricter types usage in several PyArg_ParseTuple calls
2012-03-04 18:01:08 +00:00
Daniele Varrazzo
0e832b97ea
Proper type check in prepare() methods for list, binary, qstring
2012-03-04 17:59:51 +00:00
Daniele Varrazzo
84f2a370f6
close() methods don't raise errors if called on closed objects
2012-03-04 05:10:07 +00:00
Daniele Varrazzo
2cbedbee45
Dropped test about close() on closed connection raising an exception
...
This seems unnecessary and has caused problems to a few. The DB-SIG seems
agreeing on the change:
http://mail.python.org/pipermail/db-sig/2011-October/005811.html
2012-03-04 05:10:06 +00:00
Daniele Varrazzo
76cc838a93
Expressions rewritten in a more normal way
...
(double)'0'? :)
2012-03-04 04:47:21 +00:00
Daniele Varrazzo
5bbfd38dfb
Check for errors in float adaptation
2012-03-04 04:43:14 +00:00
Daniele Varrazzo
6cece00958
Check failed list creation in array adaptation
2012-03-04 04:42:44 +00:00
Daniele Varrazzo
be35df3818
Fixed typecasters refcount
2012-03-04 04:41:36 +00:00
Daniele Varrazzo
dc4c3d3143
Guard from failed keys creation during adaptation
2012-03-04 04:40:44 +00:00
Daniele Varrazzo
18085201c8
Guard from NULL dereference if Xid allocation fails
2012-03-04 04:39:41 +00:00
Daniele Varrazzo
31812c01e6
Further modeling of exception raising
2012-03-04 04:38:44 +00:00
Daniele Varrazzo
d93732558d
Raise an exception in case of failed localtime_r call
2012-03-04 04:17:03 +00:00
Daniele Varrazzo
4d15b973b0
Attempt to enforce signature for the "O&" converter functions
...
It seems causing a traceback in the static checker. Enforcing it simplifies
the code, but doesn't help the checker.
2012-03-01 02:53:29 +00:00
Daniele Varrazzo
e1266d52cd
More functions annotated for static analysis
...
Also more return values checked for values < 0 for errors, instead of
checking == 0 and leaving the positive side unchecked
2012-03-01 02:53:28 +00:00
Daniele Varrazzo
5bfb6cdefe
Use more compact macros to annotate functions for the static checker
2012-03-01 02:53:28 +00:00
Daniele Varrazzo
f2e4a8ed78
Functions setting exception return a negative value on error
...
This works around another shortcoming of the static checker; also to be
discussed with the author.
2012-03-01 02:53:28 +00:00
Daniele Varrazzo
9432787279
Work around a false positive returned by the static checker
...
To be submitted to the author.
2012-03-01 02:53:28 +00:00
Daniele Varrazzo
a167822e26
Use the newly provided attributes to validate exceptions raising
...
Be more consistent in using 0 for success, <0 for failure, and to check
for values < 0 instead of specific -1.
2012-03-01 02:53:28 +00:00
Marti Raudsepp
b97599166e
Update all links to PostgreSQL docs to the current version.
...
I also checked all links and anchors to make sure they're still valid.
2012-02-28 18:28:07 +02:00
Daniele Varrazzo
67712e4226
Fixed possible NULL dereferencing in fetchmany()/fetchall()
2012-02-24 22:26:02 +00:00
Daniele Varrazzo
6d76e81166
Fixed possible NULL dereferencing in callproc()
2012-02-24 22:26:02 +00:00
Daniele Varrazzo
94a53b48df
Building rows simplified
...
Dropped repeated checks for tuple_factory.
Internal functions refactored a bit.
2012-02-24 22:26:02 +00:00
Daniele Varrazzo
efee049338
Added error check in _mogrify for failed tuple creation
2012-02-24 22:26:02 +00:00
Daniele Varrazzo
0ee641361b
Flag a few other functions returning borrowed refs
2012-02-24 22:26:01 +00:00
Daniele Varrazzo
4ecfd48671
Fixed possible NULL dereferencing in notice process
2012-02-24 22:25:56 +00:00
Daniele Varrazzo
a6df55f4e3
Flag the psycopg_ensure_*() functions as stealing a ref
2012-02-24 10:41:02 +00:00
Daniele Varrazzo
5f3f35a2c2
Mark getnextarg function as returning a borrowed reference
2012-02-24 04:25:08 +00:00
Daniele Varrazzo
fc78fb09c0
Dropped unused pq_resolve_critical() return value
2012-02-24 04:00:12 +00:00
Daniele Varrazzo
4eea8bc912
Dropped redundant check on the status before rollback
...
The check is better done inside the critical section.
2012-02-24 03:28:20 +00:00
Daniele Varrazzo
5fcbe7bd0f
Check/set connection status at commit inside the critical section
...
Failing to do so was causing the issue reported in ticket #103 . The issue
as reported was fixed when SET ISOLATION LEVEL was dropped, but the real
problem wasn't fixed.
2012-02-24 03:28:20 +00:00
Daniele Varrazzo
b2c61eaa18
Merge branch 'types-arrays' into devel
2012-02-24 00:35:21 +00:00
Daniele Varrazzo
a165f86127
Added docs about how to create a generic array typecaster
2012-02-24 00:33:28 +00:00
Daniele Varrazzo
0c337a2029
Added support for inet array
2012-02-23 23:56:55 +00:00
Daniele Varrazzo
36b6c80ed1
register_uuid takes more iterables types as oids argument
...
Also added docs for the function parameters.
2012-02-23 23:51:28 +00:00
Daniele Varrazzo
9ffa1f4b59
Fixed inet test that wasn't testing anything
2012-02-23 23:35:05 +00:00
Daniele Varrazzo
98d6d96ee3
Fixed exception testing on Python 3
...
...and so caught exceptions are local to the except suite in Py3.
(Lo sapevate? Sapevatelo!)
2012-02-23 23:15:42 +00:00
Daniele Varrazzo
e57f3284eb
Merge branch 'cursors-rownumber' into devel
2012-02-23 23:05:40 +00:00
Daniele Varrazzo
1d7e6afcf0
Ticket #100 closed
...
Note that rownumber is still broken for named cursors: it is reset to zero
when each itersize block is fetched.
2012-02-23 23:04:54 +00:00
Daniele Varrazzo
b8597dc1d3
Fixed NamedTupleCursor rownumber during iteration.
...
The correction is similar to the other one for the other subclasses.
Also added tests for rowcount and rownumber during different fetch styles.
Just in case.
2012-02-23 22:58:58 +00:00
Daniele Varrazzo
ebec522a07
Fixed rownumber for cursor subclasses during iterations
...
Regression introduced to fix ticket #80 . Don't use fetchmany to get the
chunks of values. I did it that way because I was ending up into infinite
recursion calling __iter__ from __iter__: the solution has been the
"while 1: yield next()" idiom.
2012-02-23 22:55:13 +00:00
Daniele Varrazzo
7221ea9ec5
Added test to check rowcount behaves fine during named cursor iteration
...
Actually *it doesn't*: once we iterate the first itersize records, rowcount
is reset to zero. If we want to fix it we need an extra member in the
cursor.
2012-02-23 22:04:22 +00:00
Daniele Varrazzo
71d1690870
Test methods reordered to improve readability
2012-02-23 21:27:45 +00:00
Daniele Varrazzo
3b36100ec1
Dropped hardcoded list of exceptions in init functions
...
Use the already available exctable array.
This stops the gcc-python-plugin complaining about access to potentially
uninitialized memory.
2012-02-23 20:09:28 +00:00
Daniele Varrazzo
09be4dc5d1
Fixed potential failures while setting exceptions attributes
2012-02-23 19:48:46 +00:00
Daniele Varrazzo
7d67ecbed3
Fixed potential NULL incref
2012-02-23 19:47:36 +00:00
Daniele Varrazzo
1b27820389
Fixed refcount of exceptions dicts
2012-02-23 19:36:30 +00:00
Daniele Varrazzo
08fbd86495
Check errors in module typecasters init
2012-02-23 19:20:51 +00:00
Daniele Varrazzo
ff61cf25b6
Fixed refcount of None if namedtuples are not available
2012-02-23 18:50:06 +00:00
Daniele Varrazzo
026899e0c1
Check errors when populating encodings map
2012-02-23 18:50:06 +00:00
Daniele Varrazzo
dca6cffd6e
Dropped custom array parsing for UUID[]
...
Use the C generic array parsing exposed by new_array_type().
2012-02-23 14:41:55 +00:00
Daniele Varrazzo
f782470d71
Parens don't need escaping in regexp char classes
2012-02-23 14:41:51 +00:00
Daniele Varrazzo
1332d4a0d8
Fixed never raised exception in composite parsing
2012-02-23 14:41:46 +00:00
Daniele Varrazzo
4e1d96082a
Typos fixed in copy methods
2012-02-23 14:41:41 +00:00
Nate Eagleson
1bc73896dc
Clean up comments in setup.cfg
2012-02-22 11:59:48 +00:00
Nate Eagleson
f3f3dbbca9
Fix typos in the INSTALL document
...
Also remove a bit of extraneous whitespace.
2012-02-22 11:59:48 +00:00
Daniele Varrazzo
91388d2c51
Cite Menno's TZ improvements into news file
2012-01-30 13:32:58 +00:00
Menno Smits
bca7200b3f
Cache FixedOffsetTimezone instances
...
Avoid creating new a new FixedOffsetTimezone instance if one with the
same offset and name has been created before. This will save memory
when returning many rows containing "timestamp with timezone" columns,
and also improves comparability.
2012-01-30 13:27:40 +00:00
Menno Smits
1469a56512
Fixed repr for FixedOffsetTimezone for offsets west of UTC (negative)
...
The offset displayed was always positive and somewhat confusing. The
offset displayed now is the offset that the instance was created
with.
Also added some tests for initialisation.
2012-01-30 13:27:01 +00:00
Menno Smits
35ff2def34
Renamed shadowed test method
2012-01-29 19:35:38 +00:00
Daniele Varrazzo
78895e6943
Added doc for Error.cursor
2012-01-19 01:30:46 +00:00
Daniele Varrazzo
db987250c8
Avoid installing Error.__reduce_ex__ on Python 2.4
...
It is not used by the pickle protocol, and if called manually fails in an
unsettling way, probably because the exceptions were old-style classes.
2012-01-14 18:01:15 +00:00
Daniele Varrazzo
43daba38e7
Make Error and subclasses picklable
...
Useful for multiprocessing interaction.
Closes ticket #90 .
2012-01-14 17:34:09 +00:00
Daniele Varrazzo
28f1013c2a
Dropped duplicate import
2012-01-14 17:28:37 +00:00
Daniele Varrazzo
6f21111a92
Docs/cleanup for the lo_creat patch
2012-01-10 21:51:34 +00:00
Giovanni Mascellani
e1700fe28b
Use lo_creat() instead of lo_create() when creating large objects without new_oid.
...
This enhances the compatibility with the pgpool-II replication middleware,
that doesn't support lo_create() calls.
2012-01-10 20:49:58 +00:00
Giovanni Mascellani
8ec9b0f3d9
Use lo_creat() instead of lo_create() when creating large objects without new_oid.
...
This enhances the compatibility with the pgpool-II replication middleware,
that doesn't support lo_create() calls.
2012-01-10 11:12:06 +01:00
Daniele Varrazzo
dcc60131a9
fetchmany accepts None as size, meaning the default arraysize
...
without this care, extending fetchmany in subclasses becomes tricky.
Closes ticket #84 .
2012-01-10 01:32:45 +00:00
Daniele Varrazzo
09a8e7bf1f
Fixed cursor.fetchmany docstring
2012-01-10 01:28:14 +00:00
Daniele Varrazzo
05fb0e2fbf
Added tests to verify ticket #84
...
fetchmany() with no arg is broken in cursor subclasses.
2012-01-10 01:27:43 +00:00
Daniele Varrazzo
702ae0a904
Force GC during weakref tests
...
Required to run the tests under PyPy with no refcount. See
https://github.com/mvantellingen/psycopg2-ctypes/pull/15#issuecomment-3274618
2011-12-26 22:35:33 +01:00
Daniele Varrazzo
ede0e145dd
Added tests for cursor scroll
2011-12-26 22:00:25 +01:00
Daniele Varrazzo
7990425801
Bump to next dev version
2011-12-26 20:06:10 +01:00