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
Federico Di Gregorio
0bc49147d1
Merge branch 'devel'
2011-12-19 11:30:20 +01:00
Federico Di Gregorio
c22e8ef808
Preparing release 2.4.4
2011-12-19 10:57:38 +01:00
Federico Di Gregorio
56482d3300
Merge remote-tracking branch 'piro/devel' into devel
...
Conflicts:
NEWS
2011-12-19 10:55:55 +01:00
Daniele Varrazzo
2af563227a
make_errorcodes updated to the current page style
2011-12-16 14:49:49 +00:00
Daniele Varrazzo
3094371621
Fixed doc for supported PG versions in errorcodes table
2011-12-16 12:37:38 +00:00
Daniele Varrazzo
d6e0b284e7
Map error classes 20 and HV to more specific exceptions
2011-12-16 12:26:27 +00:00
Daniele Varrazzo
08fa6550ab
Docs typo fixed
2011-12-16 11:09:20 +00:00
Federico Di Gregorio
71a4c2bac9
Fixed rollback on error on Zope (ticket #73 )
2011-12-16 10:37:01 +01:00
Daniele Varrazzo
b721421633
A bunch of typos fixed in the examples by Josh Kupershmidt
2011-12-15 23:58:22 +00:00
Daniele Varrazzo
c3914b8aa2
Improvements to the docs homepage after Bucko's proofreading
2011-12-15 22:13:20 +00:00
Daniele Varrazzo
9e8fc349b9
Docs homepage refreshed with new bragging and links
2011-12-15 21:42:08 +00:00
Daniele Varrazzo
5f098de7e8
A bunch of changes registered in the NEWS file
2011-12-15 20:17:36 +00:00
Daniele Varrazzo
2cf35b69de
'register_composite()' also works with tables
...
Skip dropped and hidden columns when inspecting the schema.
2011-12-15 20:11:17 +00:00
Daniele Varrazzo
a4485022b5
Use 'autocommit' to check if to rollback after extra types registration
...
isolation_level currently requires an extra query, autocommit doesn't.
2011-12-15 19:56:52 +00:00
Daniele Varrazzo
bb8e1e9455
Fixed error in schema mismatch in composite caster
2011-12-15 19:56:52 +00:00
Daniele Varrazzo
ba7a0a3008
Raise DatabaseError instead of error with bad exception informations
...
We can actually raise these exceptions in weird situations,
e.g. see ticket #82 .
2011-12-15 17:50:31 +00:00
Daniele Varrazzo
424bc310a6
Use isolation level symbolic constants in examples
2011-12-15 13:10:36 +00:00
Daniele Varrazzo
5a6a303d43
A couple of fixes to psycopg1
...
_psycopg.connect is no more. Also use symbolic consts instead of values
for the isolation level.
2011-12-15 13:06:32 +00:00
Daniele Varrazzo
b5de04d2ff
Put back a distinct ISOLATION_LEVEL_READ_UNCOMMITTED value
2011-12-15 12:53:48 +00:00
Federico Di Gregorio
d2d94e203f
Reverted isolation level values to backward compatible values
...
This basically removes the READ UNCOMMITED level (that internally
PostgreSQL maps to READ COMMITED anyway) to keep the numeric values
compattible with old psycopg versions. For full details and discussion
see this thread:
http://archives.postgresql.org/psycopg/2011-12/msg00008.php
2011-12-15 12:25:19 +01:00
Daniele Varrazzo
8473209d24
Named DictCursor/RealDictCursor honour itersize
...
Closes ticket #80 .
2011-12-11 22:06:15 +00:00
Daniele Varrazzo
8606d83507
Bump to next development version
2011-12-11 22:06:15 +00:00
Federico Di Gregorio
ba34b6942f
Merge branch 'devel'
2011-12-11 22:18:11 +01:00
Federico Di Gregorio
2efe3efdfa
Preparing release 2.4.3
2011-12-11 22:17:54 +01:00
Daniele Varrazzo
088978e7b1
Typo fixed writeable -> writable
...
Closes ticket #79 .
2011-12-11 02:55:29 +00:00
Daniele Varrazzo
ad3a198919
Fixed reference leak with arguments referenced more than once in queries
...
Plus, some more care in objects life cycle, mostly in exceptions handling.
Closes ticket #81 .
2011-12-11 02:52:06 +00:00
Daniele Varrazzo
cdb19a2329
Prepare for Linux 3
2011-11-26 19:08:20 +00:00
Daniele Varrazzo
0fccc10777
Tests in order
...
Just to know where to put the next one
2011-11-18 00:10:53 +00:00
Daniele Varrazzo
2cf44fdddd
Merge branch 'connect-keywords' into devel
2011-11-18 00:05:44 +00:00
Daniele Varrazzo
a6aea38540
Added keywords on connect to news file
2011-11-17 21:51:24 +00:00
Daniele Varrazzo
417203f68e
Added test to check connect() with no parameters
2011-11-17 21:51:24 +00:00
Daniele Varrazzo
e18d27c475
Reproducing/documenting odd behaviours of connect()
2011-11-17 21:51:24 +00:00
Daniele Varrazzo
625cc1b402
Escape parameters to the connection strings as required by PQconnectdb
2011-11-17 21:51:24 +00:00
Daniele Varrazzo
99ac79511c
Added test module to verify the dsn manipulation
2011-11-17 21:51:24 +00:00
Daniele Varrazzo
d2b67364fd
connect() supports generic keyword arguments passed to the dsn
2011-11-17 01:51:25 +00:00
Daniele Varrazzo
4254fb8566
Documentation for the isolation level constants updated
...
REPEATABLE READ and SERIALIZABLE are no more synonyms since PostgreSQL 9.1,
and in Psycopg values are different since 2.4.2.
2011-11-17 00:41:44 +00:00
Daniele Varrazzo
dc94a3cb2d
Check for connection closed before getting the isolation level
...
Closes ticket #74
Also added test to check regressions in isolation_level,
set_isolation_level, set_session, autocommit.
2011-11-16 23:51:05 +00:00
Daniele Varrazzo
a76d0525d1
Dropped unused variable
2011-11-01 07:42:22 +00:00
Daniele Varrazzo
865fb2d792
Work around mxDateTime 3.2.0 segfault in tests
2011-11-01 07:42:08 +00:00
Daniele Varrazzo
00b52c78b3
Docs cleanup by Josh Kupershmidt
2011-11-01 07:09:51 +00:00
Daniele Varrazzo
5728649944
Merge branch 'fix-copy-on-win' into devel
2011-10-20 11:12:43 +01:00
Daniele Varrazzo
83d457361e
Fixed docs for the copy null parameter
2011-10-20 11:12:05 +01:00
Daniele Varrazzo
2671472de8
Dropped leftover extra char, already accounted for before
2011-10-20 11:11:57 +01:00
Federico Di Gregorio
512b41cc9c
Fix encoding when Zope explicitly pass empty "enc" argument
2011-10-20 09:52:22 +02:00
Daniele Varrazzo
6fc167a7b1
Unregister the composite array caster after the test
...
Otherwise the refcount script will report a leak.
2011-10-19 22:00:59 +01:00
Daniele Varrazzo
60b49f5c45
Avoid PyOS_snprintf to calculate the copy command buffer size
...
On windows it returns -1 instead of sometihing portable. So just ditch
the static buffer and just use a dynamic one to compose the command.
Also squashed a couple of buglets in copy_to: copyfile was decremented
before being set to null, size_t was used instead of Py_ssize_t.
2011-10-19 21:01:53 +01:00
Daniele Varrazzo
ff8158d7c0
Simplification in the COPY command composition
...
Dropped the branch if NULL is specified or not: just use the default \N.
Also fixed copy_from/copy_to docstrings.
2011-10-19 20:31:09 +01:00
Daniele Varrazzo
0f4fd0d828
Test suite fixed to make it compatible with the ctypes implementation
2011-10-19 02:25:53 +01:00
Daniele Varrazzo
d79661c87f
All unit test modules have a test_ prefix
...
Both for consistency and for test discovery.
2011-10-19 02:20:43 +01:00
Daniele Varrazzo
3e39b23835
Notice -> Note in the docs, and a handful of other typo fixed
2011-10-14 23:59:49 +01:00
Daniele Varrazzo
37a9eb3615
Test and document the named cursor stealing technique
2011-10-14 23:17:24 +01:00
Daniele Varrazzo
dde4c0de3d
Decimal adapter registration moved from C to Python
...
Fixes Decimal adaptation in sub-interpreter, where the Decimal class has
a different identity from the one in the main interpreter.
Closes ticket #52 .
2011-10-14 22:35:56 +01:00
Daniele Varrazzo
6da39e3a37
Fixed pasto in docs
2011-10-06 18:38:30 +01:00
Daniele Varrazzo
5fa1729000
Skip test on array of records on PG 8.3
2011-10-05 00:44:44 +01:00
Daniele Varrazzo
e4424bdfdc
Fixed tests to run with antebellum Postgres versions
2011-10-05 00:12:35 +01:00
Daniele Varrazzo
50b445fa12
Merge branch 'array-typecast' into devel
2011-09-22 20:00:08 +02:00
Daniele Varrazzo
8963b8adcb
Added support for arrays of composite types
2011-09-22 19:57:42 +02:00
Daniele Varrazzo
2f9ceeac64
Added support for arrays of hstores
2011-09-22 19:56:58 +02:00
Daniele Varrazzo
c4e6d7d982
Fixed typecasting of arrays containing consecutive backslashes
2011-09-22 18:14:16 +01:00
Daniele Varrazzo
e3054ac9f3
Added new_array_type() function
...
Allows the creation of a generic array typecaster from Python.
2011-09-22 15:51:21 +01:00
Daniele Varrazzo
6c8051907c
Fixed doc blocks
...
Raise error with docutils 0.8.1. Probably docutils 0.7 was more lenient.
2011-09-22 15:50:50 +01:00
Daniele Varrazzo
cd6e2cd8f2
Don't leak private variables into the psycopg2.extensions interface
2011-09-22 14:34:14 +01:00
Daniele Varrazzo
8fb08efae7
Allocate dynamically memory for the list of columns in COPY
...
Some bloke finds the limit of 8K too restrictive... ticket #68 .
2011-09-12 02:21:59 +01:00
Daniele Varrazzo
d67d50b434
Fixed interaction between RealDictCursor and named cursors
...
Closes ticket #67 .
2011-09-12 02:20:53 +01:00
Daniele Varrazzo
29932c488f
errorcodes map updated to PostgreSQL 9.1
2011-08-22 17:29:14 +01:00
Federico Di Gregorio
880aa07a58
WITH HOLD documentation a argument parsing changes
...
Now any true value will do for the withhold parameter.
2011-08-10 19:21:12 +02:00
Federico Di Gregorio
a59d88c703
Merge remote-tracking branch 'piro/devel' into devel
2011-08-10 18:36:24 +02:00
Federico Di Gregorio
479bdf7458
New 'withhold' parameter for connection.cursor()
2011-08-10 18:25:46 +02:00
Daniele Varrazzo
1861e0010d
Fixed --static-libpq setup option (ticket #64 )
2011-08-09 11:44:30 +01:00
Daniele Varrazzo
9870ca4dce
Fixed NamedTupleCursor.executemany() (ticket #65 )
2011-08-09 11:44:30 +01:00
Daniele Varrazzo
a2ee25ecfe
Check the connection status before putting back into the pool
...
Rollback connections in transaction or in error.
Discard broken connections.
Closes ticket #62 .
2011-08-09 11:44:30 +01:00
Daniele Varrazzo
11ff27b5af
Added documentation for putconn's close parameter
2011-08-09 11:44:30 +01:00
Daniele Varrazzo
4fd5f3267b
Raise PoolError when putting a connection not belonging to the pool
...
A KeyError was raised instead.
2011-08-09 11:44:30 +01:00
Daniele Varrazzo
de6f2ac387
Grab the GIL when checking for errors occurred
...
The problem was causing a segfault on BEGIN if the server is disconnected
after the connection is created.
2011-08-09 11:44:30 +01:00
Daniele Varrazzo
d9fce1f837
Mention the lazy uuid import in the news file
2011-08-09 11:44:30 +01:00
Daniele Varrazzo
e3b32dcee1
Bump to next dev version
2011-08-09 11:44:30 +01:00
Daniele Varrazzo
30a046c602
Fixed adaptation doc example
...
Close ticket #63
2011-07-24 20:42:23 +01:00
Federico Di Gregorio
2f6336ea78
First try at curs.withhold implementation
2011-07-05 10:28:34 +02:00
Marko Kreen
cb1d163f4f
lazy import for uuid module
...
Attached patch moves uuid import from inside try-except
to register_uuid function. Reason: uuid module import is *very*
heavy. It goes into OS searching for various .dll/.so libraries,
lauches 'ldconfig' and so on...
With this patch, 200x python -c 'import psycopg2.extras'
goes from 22s to 7s. (plain 'import psycopg2' is 6s)
--
marko
2011-06-28 17:28:43 +02:00
Federico Di Gregorio
f8ff2ccc49
Merge branch 'devel'
2011-06-13 18:53:48 +02:00
Federico Di Gregorio
f8a5dabdc1
Preparing release 2.4.2
2011-06-12 21:40:44 +02:00
Federico Di Gregorio
3ec9677978
Aligned casing of isolation levels with PostgreSQL documentation
2011-06-12 21:40:31 +02:00
Daniele Varrazzo
d76d136b4f
Introductory docs section on transaction control improved
...
Added big fat warning about idle in transaction and reference to
set_session().
2011-06-08 14:38:57 +01:00
Daniele Varrazzo
d2b28abced
Method set_transaction() renamed to set_session()
...
In fact it doesn't change "the transaction", as there has to be no
transaction when invoked. The effect instead is to execute SET SESSION
CHARACTERISTICS.
2011-06-08 14:22:11 +01:00
Daniele Varrazzo
1a51cfe274
Better error message if deferrable is used in PG < 9.1
2011-06-08 10:59:27 +01:00
Daniele Varrazzo
0a1bbb56cd
Dropped redundant semicolons at the end of internal queries
...
For consistency with other queries, and probably we give less work to do
to the server parser (a ridiculously tiny amount).
2011-06-08 09:22:35 +01:00
Daniele Varrazzo
5c13dac5ff
Merge branch 'setup-cleanup' into devel
2011-06-08 08:22:03 +01:00
Jason Erickson
5ee7bac66b
No manifest reinsertion into 2.4/2.5 with MSVC
...
Python versions 2.4 and 2.5 for MSVC on Windows do not need to manifest file
reinserted into the DLL. The VC compiler for these versions does not have the
mt.exe executable to insert the manifest file.
2011-06-08 08:21:32 +01:00
Daniele Varrazzo
178698f9e8
Merge branch 'setup-cleanup' into devel
2011-06-07 23:58:58 +01:00
Daniele Varrazzo
7b017e7944
Mention Steve and his work in the NEWS file
...
That's Steve's Job! :D
2011-06-07 23:58:37 +01:00
Daniele Varrazzo
dc92161dda
Delay detection of the compiler in setup.py
...
At init time, build_ext is not configured, so neither the --compiler option
nor settings in setup.cfg/distutil.cfg is effective.
Steve, I told you distutils was a mess :)
2011-06-07 23:28:17 +01:00
Daniele Varrazzo
d0b97feab3
More cleanup in pg_config detection from Windows registry
2011-06-07 22:35:22 +01:00
Steve Lacy
575afa2e0e
Properly detect pg_config.exe on Windows.
...
I'm fairly certain this is correct, submitting so I can pull on my Windows
box and do some testing there.
2011-06-07 22:35:22 +01:00
Steve Lacy
46dc7e66f8
Fix pg_config commandline option broken in a previous change
...
- Make sure to declare self.pg_config in initialize_options.
- Don't declare PostgresConfig in __init__, as its scope is limited.
- Pass build_ext instance to PostgresConfig to avoid having to
call the option parser directly.
2011-06-07 22:22:08 +01:00
Steve Lacy
57a6cf3144
Code to find an executable on the current PATH refactored
2011-06-07 22:18:56 +01:00
Daniele Varrazzo
6d907df14d
Fixed documentation for COPY methods
...
The size parameter in copy_from was undocumented (ticket #59 ).
2011-06-07 11:16:10 +01:00
Daniele Varrazzo
9b5ac79513
Fixed default size for read copy buffer
...
The original commit stated it should have been 8192.
2011-06-07 11:16:06 +01:00
Daniele Varrazzo
9a7aee3d05
Fixed compatibility problem in setup for Python 2.4
2011-06-07 08:58:54 +01:00
Steve Lacy
ef18915396
Unify the way the MSVC compiler is detected
...
And do it only once in __init__ instead of different ways
and in different places.
2011-06-07 08:41:57 +01:00
Steve Lacy
c826446ff8
Clean up a bunch of lint from pylint/pyflakes/pep8 checking
...
- Don't override global variable name "ext" (use "extension" as function
argument names)
- Improve function naming (get_compiler -> get_compiler_name)
- Other misc operator spacing and 80-column violation cleanup.
- Remove unneeded import (DistUtilsFileError)
2011-06-07 08:40:40 +01:00
Steve Lacy
f3526d0630
Refactoring of the pg_config detection code in setup.py
...
Pull all state and path searching into it's own class.
2011-06-07 08:40:19 +01:00
Daniele Varrazzo
816b5dda33
Merge branch 'copy-refcount-bug' into devel
2011-06-07 01:20:37 +01:00
Daniele Varrazzo
679af4a975
Fixed copyfile refcount in copy_expert
...
In case of early error, jumping to exit would have decref'd the borrowed
reference to file.
Issue spotted by Dave Malcolm, thanks!
2011-06-07 01:20:25 +01:00
Daniele Varrazzo
e9a485e30b
Merge branch 'copy-refcount-bug' into devel
2011-06-07 00:14:11 +01:00
Daniele Varrazzo
b6e710b0fc
Fixed refcount bug in copy_to() and copy_expert() methods too
2011-06-07 00:08:29 +01:00
Daniele Varrazzo
1888bf41c0
Added patch for refcount bug in copy_from
...
By Dave Malcolm. https://bugzilla.redhat.com/show_bug.cgi?id=711095
(slightly edited to increment the refcount before storing the pointer
in the cursor).
2011-06-07 00:08:29 +01:00
Daniele Varrazzo
2a1b2b5713
Added script to demonstrate the refcount bug during copy
...
from https://bugzilla.redhat.com/show_bug.cgi?id=711095
2011-06-07 00:08:29 +01:00
Jason Erickson
dd7ee7093a
No strcasecmp function with MSVC
...
The MSVC compiler does not have the strcasecmp(x, y) function, which is a
case insensitve string compare function. Instead, MSVC has a similar function,
lstrcmpi(x, y). Modified config.h to use this function when building with
MSVC.
2011-06-05 23:33:28 +01:00
Daniele Varrazzo
442a0606fe
Merge branch 'guc-cleanup' into devel
2011-06-05 16:31:25 +01:00
Daniele Varrazzo
709df38d79
Don't clobber an eventual Python exception set by a green thread
2011-06-05 16:30:37 +01:00
Daniele Varrazzo
869d48b6f0
Use the pqpath functions to get/set GUC parameters
...
Functions conn_setup(), conn_get_isolation_level(), conn_set_transaction(),
conn_switch_isolation_level(), conn_set_client_encoding() reimplemented
using the pqpath funtitons.
Dropped analogous function in the connection, as it had to take the lock,
thus it was hard to build consistent pieces of functionality with it.
2011-06-05 16:26:01 +01:00
Daniele Varrazzo
8f876d4b5d
Avoid a deadlock using concurrent green threads on the same connection
...
Use the async_cursor property to store an indication that something is
running (even if it is not necessarily a cursor running the query).
2011-06-05 16:22:54 +01:00
Daniele Varrazzo
cf6a4ec062
Added pqpath functions to get/set the value for GUC parameters
...
The aim of these function is to allow the connection to make a better use
of the pqpath functions instead of using PQexec for these small things.
Also, the functions are to be called with the connection lock: this makes
composing higher level functions using them easier.
2011-06-05 15:36:02 +01:00
Daniele Varrazzo
dcc9e84a68
Don't encode the pg_config path on Python 3 on Windows
...
It can deal with unicode ok, and fails if it gets bytes.
2011-06-04 22:26:21 +01:00
Daniele Varrazzo
a0d16fcfb2
Avoid a ton of warnings when building on mingw
...
mingw doesn't support visibility hidden even if gcc can.
2011-06-04 22:19:56 +01:00
Daniele Varrazzo
62a8ef308a
Fixed version check
2011-06-04 14:21:18 +01:00
Daniele Varrazzo
c8ec747903
Don't fail import if mx.DateTime module is not found at import time
...
A better fix for ticket #53 .
2011-06-04 14:16:24 +01:00
Daniele Varrazzo
05659c0d16
Cleanup of notice processing
...
The function is always called in the context of functions grabbing the
connection lock, so just use the same critical section instead of releasing
and re-acquiring it. It is not a problem as serious as the notifies process
(ticket #55 ) as the notices are a psycopg structure, not libpq. However the
change allows again processing notices/notifies in the same place,
which makes sense conceptually, plus we save some lock dance.
2011-06-04 01:49:03 +01:00
Daniele Varrazzo
d9c0b8166f
Process notifies when data is received, not when the result is parsed
...
Notifies process access the connection, is not limited to the result, so
There is the possibility of loss of protocol sync in multithread programs.
Closes ticket #55 .
2011-06-04 01:31:36 +01:00
Daniele Varrazzo
3aad3d3143
Fixed test to run on Python <= 2.5
...
tuple.index() is not available on these versions.
2011-06-03 09:31:06 +01:00
Daniele Varrazzo
0eb5e0430e
Merge branch 'transaction-control' into devel
2011-06-03 01:48:24 +01:00
Daniele Varrazzo
530ba78881
Documentation for set_transaction() and autocommit improved
2011-06-03 01:46:56 +01:00
Daniele Varrazzo
5748ae14bf
Test tweaked to deal with missing usecs in BC timestamps
...
Probably depending on compile time options. On my test db usecs
are available from PG 8.4.
2011-06-03 00:54:33 +01:00
Daniele Varrazzo
4d3c6865ee
Use only the isolation levels available on old PG versions
2011-06-03 00:40:54 +01:00
Daniele Varrazzo
c2d1f1f2e6
Dropped isolation level from the connection object
...
Don't issue a SET TRANSACTION ISOLATION LEVEL at every begin: use PG's
GUC default, eventually set by set_transaction.
Dropped the last query at connection, yay!
Method set_isolation_level() and property isolation_level refactored using
the new structures, keeping the previous semantic.
2011-06-03 00:10:24 +01:00
Daniele Varrazzo
389f2cf1d0
Added autocommit property on connection
2011-06-02 01:16:22 +01:00
Daniele Varrazzo
ea03ffbf76
Added partial implementation for set_transaction
...
autocommit to be implemented yet.
2011-06-01 09:07:02 +01:00
Daniele Varrazzo
a69facc7f0
Adding docs for the planned set_transaction/autocommit features
2011-05-31 00:05:50 +01:00
Daniele Varrazzo
531292bca5
Merge branch 'neg-escape' into devel
2011-05-30 22:09:23 +01:00
Daniele Varrazzo
281427f450
Fixed escape for negative numbers prefixed by minus operator
...
Closes ticket #57 .
2011-05-30 22:00:20 +01:00
Daniele Varrazzo
19ec8809fd
Use all the isolation levels accepted by PostgreSQL
...
In PG 9.1 repeatable read and serializable are distinct levels.
2011-05-11 13:01:20 +01:00
Daniele Varrazzo
834c7d1288
Fixed a few docstrings mixed up
2011-05-11 12:59:31 +01:00
Daniele Varrazzo
af424821b7
Don't build mx.DateTime support if the module can't be imported
...
Previously we only checked for the existence of the include files, but this
doesn't imply the presence of the module. Particularly true in restricted
environments such as virtualenv.
Closes ticket #53 .
2011-05-11 12:59:31 +01:00
Daniele Varrazzo
c687f1d816
Bump to next development release
2011-05-11 12:59:31 +01:00
Federico Di Gregorio
ab685c2fc0
Merge branch 'devel'
2011-05-11 09:58:49 +02:00
Federico Di Gregorio
9080b30741
Preparing release 2.4.1
2011-05-11 09:58:34 +02:00
Daniele Varrazzo
de6aff31b8
Skip a test on the proper PG function
2011-04-27 12:18:50 +01:00
Daniele Varrazzo
c61ec094a3
Don't fetch all the records iterating a NamedTuple cursor on a named cursor
2011-04-26 19:26:19 +01:00
Daniele Varrazzo
ffa7a62b93
Fixed interaction between NamedTuple and named cursor
...
Build the nametuple after fetching the first resutl, or else
cursor.description will be empty.
2011-04-26 19:18:39 +01:00
Daniele Varrazzo
80891e64b3
Dropped unused import
2011-04-26 19:16:10 +01:00
Daniele Varrazzo
c08799b0b0
Fixed SystemError clobbering libpq errors raised without SQLSTATE
...
Bug vivisectioned by Eric Snow
<http://archives.postgresql.org/psycopg/2011-04/msg00019.php >.
2011-04-24 02:59:28 +01:00
Daniele Varrazzo
746afdf69f
Added missing vertical spaces in NEWS
2011-04-15 01:11:22 +01:00
Daniele Varrazzo
e316d7bcd4
Merge branch 'fix-encoding' into devel
2011-04-09 14:47:07 +01:00
Daniele Varrazzo
e3605b33c1
Updated NEWS with the connection encoding fix
2011-04-08 14:36:49 +01:00
Daniele Varrazzo
19653a88ec
Store a normalized version of the PG encoding in the connection
...
This way looking up into extensions.encodings will not break.
2011-04-08 13:48:11 +01:00
Daniele Varrazzo
88803695ac
Normalize the encoding name at connection
...
The encoding can be set by PGCLIENTENCODING, which may be an alternative
spelling. Bug reported by Peter Eisentraut.
At this point the idea of considering one of the random spellings such as
EUC_CN as somewhat "blessed" is debunked. So just store the cleaned-up
version of the encoding in the mapping table. Note that the cleaned-up
version was needed by the unicode adapter: this requirement has been
surpassed as the connection now contains a copy of the Python codec name
set whenever the client encoding is set.
2011-04-08 13:48:11 +01:00
Daniele Varrazzo
bf48706868
Don't check the test db exists at psycopg2.tests import time
2011-03-30 15:52:49 +01:00
Daniele Varrazzo
2dab7d52f2
Fixed bytea encoding tests skipping when ctypes is not available
2011-03-26 14:27:58 +00:00
Daniele Varrazzo
7716cc6a0c
Allow to specify --static-libpq on setup.py command line
...
Patch provided by Matthew Ryan (ticket #48 ).
2011-03-26 13:48:37 +00:00
Daniele Varrazzo
90536a187d
Merge branch 'bytea-parser' into devel
2011-03-26 13:02:57 +00:00
Daniele Varrazzo
da58bee70a
Added documentation for the bytea parser
2011-03-26 12:59:15 +00:00
Daniele Varrazzo
e0cd6f0f00
Added tests for our own bytea parser
...
Because the parse function is not supposed to be exposed in Python,
use ctypes to directly inspect the C function.
2011-03-26 12:59:14 +00:00
Daniele Varrazzo
66c543b16c
Parse bytea output format ourselves instead of using the libpq
...
PG 9.0 uses the hex format by default, and clients < 9.0 can't parse that
format, requiring client update and great care in what is linked at runtime,
and generally giving headache to users and transitively us.
2011-03-26 12:59:14 +00:00
Daniele Varrazzo
f34e44b3f4
Merge branch 'empty-query' into devel
2011-03-04 20:33:51 +00:00
Daniele Varrazzo
fcbe0466a6
Correctly detect an empty query sent to the backend
...
Closes ticket #46 .
2011-03-04 20:30:43 +00:00
Daniele Varrazzo
f1d69f6dec
Fixed detection of empty error from pq_raise
...
Avoid a system error in case err is set to an empty string.
2011-03-04 20:20:56 +00:00
Daniele Varrazzo
4a8b5f98f3
Bump to work on 2.4.1
2011-03-04 20:18:22 +00:00
Federico Di Gregorio
29f83f05c4
Merge branch 'devel'
2011-02-27 13:03:48 +01:00
Federico Di Gregorio
2212ea96a6
Preparing release 2.4
...
* NEWS file now uses 72 columns (better in emails and posts)
* Bumped versions
* Updated MonoDevelop file
2011-02-27 12:52:00 +01:00
Daniele Varrazzo
194447fbbf
Merge branch 'msvc-cleanup' into devel
...
Merged Jason Erickson devel branch after collapsing a few commits together
where it made sense.
2011-02-25 10:29:19 +00:00
Jason Erickson
2997c0eb6c
Windows MSVC: 64bit compiler sees 2 export symbols
...
The MSVC compiler sees a request for the main symbol (init__pyscopg) to be
exported twice during the build process and issues a warning in 64bit mode.
One symbol is from distutils exporting the library with the
build_ext.get_export_symbols() function, the other is from the #define
PyMODINIT_FUNC (define in pyport.h) that begins the main _psycopg module.
This patch overrides the get_export_symbols function and returns an empty
array of symbols to export if the compiler is MSVC.
2011-02-25 10:25:12 +00:00
Jason Erickson
7c2fa77c4b
Windows MSVC: Fixed warning of incompatible types
...
Fixed incompatible type warning from XidObject * to PyObject * by
casting.
2011-02-25 10:25:12 +00:00
Jason Erickson
961e855bbd
Windows MSVC: Fix Compiler Warning: getpid
...
Fix a compiler warning when using PSYCOPG_DEBUG on MSVC where getpid is
undefined.
2011-02-25 10:25:12 +00:00
Jason Erickson
631883f62f
Windows MSVC: Fix data loss compiler warnings
...
Fixed MSVC compiler warnings where it was indicating a conversion
from a larger data type to smaller data type might have data loss.
2011-02-25 10:25:12 +00:00
Daniele Varrazzo
9e00196165
Fixed use of the new return value of HstoreAdapter.get_oids()
2011-02-25 01:37:02 +00:00
Daniele Varrazzo
5211e1474b
Don't limit the hstore search to the public schema only
...
Looks like there is a case for installing hstore somewhere else (see
ticket #45 ). And after all the typecaster can be registered on a list of
OIDs, so let's grab them all.
2011-02-25 00:19:49 +00:00
Daniele Varrazzo
29ac03ef04
Check for failed allocation in the notice callback
2011-02-24 10:14:06 +00:00
Daniele Varrazzo
343687ebc8
Fixed runtests -> check in INSTALL file
2011-02-24 10:10:27 +00:00
Jason Erickson
6f0dfe6d2d
Windows MSVC: Remove /Wp64 compiler flag
...
Remove the /Wp64 flag since it is deprecated starting in Visual Studio 2008.
2011-02-23 14:29:44 -07:00
Daniele Varrazzo
f9862211b1
NEWS for release 2.4 ordered in groups
2011-02-23 14:23:34 +00:00
Daniele Varrazzo
894d3f653c
Raise an exception if the libpq fails to decode bytea in hex format
2011-02-23 14:04:27 +00:00
Daniele Varrazzo
c01a7edbf4
Fixed test for execution with older PostgreSQL versions
2011-02-23 08:43:01 +00:00
Daniele Varrazzo
f96b68d8c6
Fixed docstring for connection.lobject()
2011-02-23 01:53:56 +00:00
Daniele Varrazzo
1db9c9b8ce
The cursor name can be a non-valid PostgreSQL identifier
2011-02-23 01:53:25 +00:00
Daniele Varrazzo
66555c5f11
Fixed call of memory functions without the GIL
2011-02-23 00:48:10 +00:00
Daniele Varrazzo
20f714f17c
Added error checking to _pq_fetch_tuples()
2011-02-23 00:32:23 +00:00
Daniele Varrazzo
c1715f66fe
More careful memory management
...
- Check return value of PyErr_Malloc and set an exception in case of error
- Avoid exposing variables with refcount 0 as connection attributes.
- PyErr_Free guards itself for NULL input
2011-02-23 00:32:23 +00:00
Daniele Varrazzo
143dc2e911
Added oid parameter to register_hstore()
...
The parameter is mostly useful with async connections that would need a
different protocol to be queried.
Issue reported by Jan "the Asynchronous".
2011-02-21 01:29:53 +00:00
Daniele Varrazzo
beffb02d56
Stricter declaration and correct use of psyco_set_error
...
It has long been used in wrong ways, with the function receiving a
connection or lobject instead of a cursor. It has always been unnoticed
(nobody has noticed the wrong object attached to the exception in the
wrong cases) but it started crashing the interpreter with Python 3.2 on
Windows.
Thanks to Jason Erickson for finding the problem and helping fixing it.
2011-02-21 00:31:09 +00:00
Daniele Varrazzo
a97e2a842d
Tweaks to test timing to avoid errors on test VMs
2011-02-20 19:33:22 +00:00
Daniele Varrazzo
d74f777339
Check for memory errors in the connection init
2011-02-20 18:57:04 +00:00
Daniele Varrazzo
7996333ee7
Added regression test to check {} is also a valid string
2011-02-20 12:28:50 +00:00
Benjamin Poulain
5ee60571a5
Add a type converter to handle untyped empty arrays.
...
Empty array can be returned untyped by postgres. To handle
this case, a special handler is added for the type UNKNOWNOID.
If the value return by the database is strictly equal to "{}",
the value is converted. Otherwise, the conversion fallback on
the default handler.
2011-02-20 12:28:10 +00:00
Daniele Varrazzo
4bc4f85229
Merge remote branch 'jason/devel' into devel
...
Conflicts:
psycopg/notify_type.c
2011-02-19 16:25:31 +00:00
Daniele Varrazzo
556b4d461e
Documentation cleanup
...
Added several links to the Python documentation using the 'intersphinx'
extension.
2011-02-19 16:16:28 +00:00
Daniele Varrazzo
75c61c2e80
Added complete roundtrip test with copy_expert and Unicode
2011-02-19 14:35:56 +00:00
Daniele Varrazzo
6098ced761
Assume there may be files returning Unicode in Python 2 too
...
This is the case in Python 2.7 with files implementing io.TextIOBase.
2011-02-19 14:24:15 +00:00
Daniele Varrazzo
8a08114314
Correctly handle exceptions with non-ascii chars in the message
...
Previous implementation would have barfed in canse of non-utf-8 data in
the message.
2011-02-19 14:16:53 +00:00
Jason Erickson
4bc47d47a5
Python 3.2 hash() return value is arch dependant
...
Python 3.2 hash() function will now return a 64bit value when run on a 64bit
architecture, where as previously, it would always return a 32bit value.
Modified the code to use the now Py_hash_t typedef and for Python versions
less than 3.2, hard code Py_hash_t to long and Py_uhash_t to unsigned long.
2011-02-18 23:57:25 -07:00
Daniele Varrazzo
d263ecfee7
Display a note as a note in the cursor.lastrowid docs
2011-02-19 00:52:26 +00:00
Daniele Varrazzo
1f7774bd4e
Cursor docs reordered
...
'cast()' moved in the retrieval functions. Methods only defined for
DBAPI compliance moved to the bottom.
2011-02-19 00:44:24 +00:00
Daniele Varrazzo
837f1e5e4f
Set hidden visibility to a few functions not public
2011-02-19 00:25:23 +00:00
Daniele Varrazzo
c620f18be1
Provide cursor.description as named tuple if possible
...
If namedtuple() is not available, use regular tuples.
2011-02-19 00:05:43 +00:00
Daniele Varrazzo
e2cbc3411d
Duplicate item in NEWS dropped, quotes cleanup
2011-02-19 00:00:34 +00:00
Jason Erickson
4fdc22451e
Merge branch 'devel' of github.com:jerickso/psycopg into devel
2011-02-18 13:08:33 -07:00
Jason Erickson
9dc6811135
Again, increase timeout on concurrent_exec tests
...
Truly increase the sleep timeout to 4 seconds and the check to 7. Previous
commit message indicated that, but reality was different.
2011-02-18 11:52:17 -07:00
Daniele Varrazzo
836f8a1aa1
Make Binary(None) work as expected, adapting to NULL
...
Issue reported by Stefano Dal Pra.
2011-02-18 14:19:57 +00:00
Daniele Varrazzo
8530ef1793
Download url set to the sdist location.
2011-02-18 13:53:57 +00:00
Daniele Varrazzo
99b3c72312
Some cleanup in mogrify
...
- Raise an exception on incomplete placeholders.
- Minor speedups.
- Don't change the string in place (??!!) if the placeholder is not s
and the value is null.
The latter point can be done because downstream we don't accept anything
different from s anyway (in the Bytes_Format function).
Notice that now the format string is constant whatever the arguments.
This means that executemany is still more inefficient than it should be
as mogrify may work only on the parameters. However this is an
implementation only worthwhile if we start supporting real parameters.
Let's talk about that for the next release.
2011-02-18 02:33:42 +00:00
Daniele Varrazzo
b6d6fbbe8c
Use a global object for NULL
...
Small optimization as NULL is a frequent value to build.
2011-02-17 20:09:52 +00:00
Daniele Varrazzo
c51165e2aa
Indentation fixed
2011-02-17 19:53:04 +00:00
Daniele Varrazzo
c76cace2ef
Improved documentation for cursor.description
...
Describe what actually happens between Psycopg and PostgreSQL, not the
basic template copied from the DBAPI.
2011-02-17 13:38:18 +00:00
Daniele Varrazzo
63ac6cdde5
Added cursor.itersize
...
The value is used to control the number of records to fetch per network
roundtrip in named cursors iteration. Used to avoid the inefficient
arraysize default of 1 without giving this value the magic meaning of
2000.
2011-02-17 12:36:02 +00:00
Daniele Varrazzo
7756eae573
Merge remote branch 'jason/devel' into devel
2011-02-17 11:50:14 +00:00
Daniele Varrazzo
1ba5f104c9
Import _psycopg as the first module in the package
...
Failing to do so, the real cause of the _psycopg import failed may get
hidden and people may get a misleading error such as "cannot import name
tz" instead.
2011-02-17 10:45:18 +00:00
Daniele Varrazzo
3b10ef8998
Documentation about new support for binary objects improved
2011-02-16 02:54:30 +00:00
Daniele Varrazzo
bccbcf42d0
Added adaptation for objects supporting the new-style buffer interface
...
Supporting this interface is required to adapt memoryview on Python 2.7 as they
don't support the old style. But because the old style is long deprecated it
makes sense to start supporting the new one.
2011-02-16 01:30:25 +00:00
Daniele Varrazzo
3ae2f221b3
Adapt bytearray and memoryview to bytes if available
2011-02-15 17:30:43 +00:00
Daniele Varrazzo
c96ba553da
Cleanup of skipping of testing methods on certain Py/PG versions
2011-02-15 17:11:07 +00:00
Daniele Varrazzo
e4a84b9ce9
Fixed error message on Binary(str) in Python 3
2011-02-15 15:53:07 +00:00
Daniele Varrazzo
be22dfb765
Skip test if clock_timestamp function is not available
2011-02-15 15:25:14 +00:00
Daniele Varrazzo
522af403c6
Added FAQ entry about the PYTHON_EGG_CACHE problem
2011-02-15 12:50:37 +00:00
Daniele Varrazzo
5b2d54669f
Fixed reference to NEWS file in the manifest
2011-02-15 12:29:14 +00:00
Daniele Varrazzo
d4eb28aed5
Dropped reference to release 2.3.3 in the docs
2011-02-15 11:00:08 +00:00
Daniele Varrazzo
c1fe0b675a
Dropped correct roundtrip of empty array
...
The feature in itself is not extremely useful and instead PostgreSQL is
not always able to cast away from text[], which is a regression see
(ticket #42 ).
2011-02-15 10:27:47 +00:00
Daniele Varrazzo
84352e8cfb
Bump version number
2011-02-15 10:26:48 +00:00
Federico Di Gregorio
93c19d18f1
Added to manifest "*.manifest" files needed by win32/VC
2011-02-15 09:25:05 +01:00
Jason Erickson
7c9d8192a3
Increase timeout on concurrent_execution test
...
With test_concurrent_execution test, checking two threads issuing a pg_sleep
of 2 seconds and and check if they complete in under 3 seconds occasionally
fails when the test is run in a virtual machine on a VM Server with other
virtual machines running. Increased the sleep to 4, and the check to 7,
giving 3 seconds buffer instead of 1 second.
2011-02-14 16:31:31 -07:00
Jason Erickson
7dfb40ce43
Windows manifest check now checks compiler type
...
Initial compiler check was only checking two python versions. Changed the
check not to check python version, but compiler version, to be compatible
with more versions of python.
2011-02-14 16:03:38 -07:00
Federico Di Gregorio
3762c67cd4
Merge branch 'devel'
2011-02-13 12:28:18 +01:00
Daniele Varrazzo
3842026bed
Bumped to 2.4 beta2
...
We may release a Windows package to let people test if ticket #20 is
fixed.
2011-02-12 20:19:14 +00:00
Daniele Varrazzo
8ab7fa596c
Merge remote branch 'jason/devel' into devel
2011-02-12 20:19:07 +00:00
Daniele Varrazzo
4c336a51bc
Added test to check issue #40
2011-02-12 20:19:02 +00:00
Marti Raudsepp
9cb72a38da
Add negative infinity support for Python->pg conversion
2011-02-12 20:19:02 +00:00
Jason Erickson
e3095edad3
Python 3 conversion failure on Windows
...
Windows is not able to create a tempfile with NamedTemporaryFile and then
open it with a second file handle without closing the first one. Added
code to close the handle, and keep the file around a little longer so it
can be reopened and rewritten to again.
2011-02-11 17:40:23 -07:00
Jason Erickson
ed42746027
Merge branch 'devel' of git://github.com/dvarrazzo/psycopg into devel
2011-02-11 13:37:19 -07:00
Daniele Varrazzo
9e9c221637
Work around a 2to3 next fixer bug in a test
2011-02-11 17:54:41 +00:00
Jason Erickson
560f52106c
Windows manifest changes based upon architecture
...
Apparently, using * for the architecture has the potential to not work on
on some amd64 systems. Added checks and split the manifest based upon
architecture.
2011-02-11 10:01:38 -07:00
Jason Erickson
da68119f7c
MSVC manifest change to work with buildbot
...
The buildbot does not seem to like the checks for if the source has
changed, forced build, etc. Removed to work with buildbot.
2011-02-10 22:55:33 -07:00
Jason Erickson
502d8e120e
Fix manifest insertion checks for MSVC py2.6/2.7
...
The manifest was never inserted because the checks were failing. Assuming
build_extension was clearing out some of the checked values.
2011-02-10 22:28:27 -07:00
Jason Erickson
f2c0a01db1
Modified code to conform to python coding standard
...
Change indention from 2 spaces to 4 spaces with recent changes.
2011-02-10 21:50:33 -07:00
Jason Erickson
68ccac1766
Fixed linefeeds on merged files to unix linefeeds
...
Merge utility changed the linefeeds from unix to windows. Changed the
linefeeds back to unix linefeeds.
2011-02-10 17:16:10 -07:00
Jason Erickson
3fc4dcec06
Merge remote branch 'upstream/devel' into devel
...
Conflicts:
setup.py
tests/__init__.py
tests/testconfig.py
2011-02-10 16:07:38 -07:00
Jason Erickson
b075017ad9
Pulled down changes from dvarrazzo branch on gh
...
Pulled the master branch from of Daniele's psycopg branch on github and
merged the changes.
2011-02-10 15:59:31 -07:00
Jason Erickson
8d28509f49
Change win32 build to reinsert VC Library Manifest
...
Added a change at the end of the build process that would reinsert the VC library manifest. This patch will fix issues when an embedded program does not have a manifest pointing to the VC 2008 runtime library, such as in an apache/mod_python situation.
Signed-off-by: Jason Erickson <jerickso@stickpeople.com>
2011-02-10 13:17:14 -07:00
Daniele Varrazzo
1a0c494417
Document difference of string handling in Python 2/3
2011-02-10 02:16:55 +00:00
Daniele Varrazzo
713b86acdf
Added FAQ point about bytea_output in PostgreSQL 9.0
2011-02-10 02:16:55 +00:00
Daniele Varrazzo
9c81f6c186
Improved adaptation documentation
...
Documented __conform__() and prepare().
2011-02-10 02:16:24 +00:00
Daniele Varrazzo
7a058403ca
Fixed mapping for composite types defined in a schema
2011-02-09 02:22:03 +01:00
Daniele Varrazzo
8ac5f0070a
Fields order enforced in composite types adapter
2011-02-09 02:21:55 +01:00
Federico Di Gregorio
352d0d1f07
Preparing 2.4 beta 1
...
* Unified NEWS (we don 't support 2.0 anymore)
* Bumped up version in setup.py and ZPsycopgDA/DA.py
2011-02-06 16:54:35 +01:00
Federico Di Gregorio
da27142882
Merge branch 'python3' into python2
2011-02-06 16:47:05 +01:00
Daniele Varrazzo
c97fa1c476
Merge branch 'iter-named-cursor' into python2
2011-02-05 15:28:30 +01:00
Daniele Varrazzo
fab31e9441
Fetch 'arraysize' records per roundtrip in named cursors iteration
...
Closes ticket #33 .
2011-02-05 15:24:00 +01:00
Daniele Varrazzo
b544354db2
COPY sends unicode to a file if it derives from io.TextIoBase
...
Fixes ticket #36 .
2011-02-05 15:12:37 +01:00
Daniele Varrazzo
b358c54f02
More efficient cursor.iter: fetch many records at time.
2011-02-04 12:22:07 +00:00
Jason Erickson
88cc5a986d
Use tests.dsn for the dsn connection string
...
Using self.conn.dsn as the dsn connection string actually has the password
'x'ed out. The initial connection replaces the password with 'x' to
obfuscate it. Using tests.dsn instead of self.conn.dsn ensures that the
correct connection string is used.
2011-02-02 17:14:29 -07:00
Jason Erickson
dcd2e19bde
Add PSYCOPG2_TESTDB_PASSWORD variable for tests
...
Add a check for the PSYCOPG2_TESTDB_PASSWORD environment variable if the
database user (or database settings) requires a password.
2011-02-02 17:14:12 -07:00
Daniele Varrazzo
8a1de1ec4e
Added test to verify named cursor efficiency.
...
Iter shouldn't fetch one record at time.
2011-02-01 03:01:47 +00:00
Daniele Varrazzo
d40b394c50
Merge branch 'python2' into python3
2011-02-01 02:27:45 +00:00
Daniele Varrazzo
9433a6879f
Merge remote branch 'origin/python2' into python2
...
Conflicts:
NEWS-2.3
2011-02-01 02:24:33 +00:00
Daniele Varrazzo
a2dcf504b5
Hopefully really fixed crash in datetime adapter.
...
Verified with gcc 4.3. Notice that on gcc 4.4 the bug was not present.
2011-02-01 02:00:47 +00:00
Daniele Varrazzo
bde443a902
Fixed standard_conforming_strings filtering in Python 3 tests
2011-01-18 02:45:31 +00:00
Daniele Varrazzo
9f90f049ab
Merge branch 'python2' into python3
...
Conflicts:
tests/bug_gc.py
tests/types_extras.py
2011-01-18 02:11:58 +00:00
Daniele Varrazzo
153c30f24b
Skip composite type tests if the server doesn't support them
2011-01-18 02:09:49 +00:00
Daniele Varrazzo
ca3d9da83b
Skip GC bug test if uuid is not available
2011-01-18 02:09:49 +00:00
Daniele Varrazzo
06059a216f
Fixed hstore test in PG 9.x with standard_conforming_strings off
2011-01-18 00:58:33 +00:00
Daniele Varrazzo
8e1257d7d0
Fixed check for pg_sleep availability in tests
...
The function is available since PG 8.2.
2011-01-18 00:57:27 +00:00
Daniele Varrazzo
d0e36d194c
Added icon removed from Zope 2.12.9 to the ZPsycopgDA package
...
Closes ticket #30 . Bug report and patch by Pumukel.
2011-01-14 16:31:57 +01:00
Daniele Varrazzo
332acccc6e
Replace b('str') with b'str' in Python 3
...
This avoids an encode() call for each of these constants.
Use a custom 2to3 fixer in setup.py to perform the conversion.
2011-01-13 11:37:40 +00:00
Daniele Varrazzo
3ba0631dbb
A few large objects tests fixed
...
The behavior changed in Python 3 after the lobject-decode merge.
2011-01-10 22:05:47 +00:00
Daniele Varrazzo
36d9ffea32
Merge branch 'lobject-decode' into python3
2011-01-10 00:49:04 +00:00
Daniele Varrazzo
789dda1173
lobject read and write can deal with both bytes and unicode
...
On write, unicode is encoded in connection encoding.
On read, respect the lobject mode 't' or 'b'.
2011-01-10 00:46:51 +00:00
Daniele Varrazzo
ba1d77a297
Large object mode parsing refactored
...
Added parsing of text/binary mode.
2011-01-10 00:46:51 +00:00
Daniele Varrazzo
f63167a92c
Added tests to check large objects decoding
2011-01-10 00:46:51 +00:00
Daniele Varrazzo
2cde9033ac
Added documentation for Unicode support in large object
...
Not implemented yet!
2011-01-10 00:46:51 +00:00
Daniele Varrazzo
79048ff19a
Merge branch 'python2' into python3
...
Conflicts:
NEWS-2.3
tests/__init__.py
tests/test_lobject.py
tests/test_quote.py
tests/testutils.py
2011-01-10 00:46:02 +00:00
Daniele Varrazzo
f345e7daeb
Merge branch 'python32' into python3
2011-01-10 00:25:09 +00:00
Daniele Varrazzo
48588e5f69
Invalidate large objects after a two-phase commit operation
2011-01-10 00:20:55 +00:00
Daniele Varrazzo
935c25730a
Fixed segfault in large object close.
...
Check that the connection is not closed/faulty before attempting lo_close.
2011-01-10 00:11:14 +00:00
Daniele Varrazzo
38641b93ea
Test decorator moved into the test utilities module
2011-01-09 23:44:58 +00:00
Daniele Varrazzo
15a09da96d
Added license to unit tests
...
As the test suite is now part of the source distribution.
2011-01-09 23:44:35 +00:00
Daniele Varrazzo
f8c4335f35
Avoid ResourceWarning in tests in Python 3.2
2011-01-08 23:54:48 +00:00
Daniele Varrazzo
43c8fce45c
Silence warnings due to deprecated TestCase methods
...
With a veiled criticism.
2011-01-08 23:54:17 +00:00
Daniele Varrazzo
ac5cde8834
Only use absolute imports in the package
...
In Python 3.2b2 the relative imports are not converted into explicit
ones (with .).
2011-01-08 01:24:28 +00:00
Daniele Varrazzo
9deb16484d
Don't define a CObject API in Python 3.2
...
The API is not available: a PyCapsule should be used. Nobody seems
needing it for now.
2011-01-08 01:24:16 +00:00
Daniele Varrazzo
7c1b03bd45
All tests made executable.
2011-01-07 00:58:29 +00:00
Daniele Varrazzo
b8c8cddc2d
Fixed argument parsing in lobject.read
...
Using an int instead of a Py_ssize_t randomly crashed Python 3.1 64 bit.
2011-01-04 02:27:02 +01:00
Daniele Varrazzo
80bd6e2794
Merge branch 'python2' into python3
...
Conflicts:
NEWS-2.3
psycopg/connection_type.c
tests/test_connection.py
tests/types_basic.py
2011-01-03 21:43:02 +01:00
Daniele Varrazzo
627df15995
Merge branch 'noleak' into python2
2011-01-03 21:39:35 +01:00
Daniele Varrazzo
8d44d0f1c7
Mention refcount fixes in NEWS files
2011-01-03 21:34:49 +01:00
Daniele Varrazzo
abd7991968
Fixed refcount bug with connection destroyed in a 2PC transaction
2011-01-03 21:34:49 +01:00
Daniele Varrazzo
5f6e773575
Broken circular reference in async execution
...
If a connection is destroyed before an async operation is completed, the
`async_cursor` member creates a reference loop, leaving the connection and
the cursor alive. `async_cursor` is now a weak reference.
2011-01-03 21:34:49 +01:00
Daniele Varrazzo
19ff51ae75
The cursor is weakly referenceable
2011-01-03 21:34:49 +01:00
Daniele Varrazzo
04cf90cc21
The connection is weakly referenceable
2011-01-03 21:34:49 +01:00
Daniele Varrazzo
5888b03608
Fixed "historical" reference leak in TimestampFromTicks
...
Added an internal function with C signature to avoid the creation of a
tuple to be later unpacked. When the tuple was decref'd, Python 2.4 64
bits regularly segfaulted; Python 2.5 less regularly; don't know about
other versions.
2011-01-03 21:34:49 +01:00
Daniele Varrazzo
8b0af283f6
Don't register the unicode typecaster globally during tests
...
It can invalidate the results in further runs in the same process.
2011-01-03 21:34:49 +01:00
Daniele Varrazzo
131c6a25e9
Unregister test adapters to keep a more precise references count
2011-01-03 21:34:46 +01:00
Daniele Varrazzo
a44441f5e5
Added script to look for refcounting bugs
2011-01-03 21:34:46 +01:00
Daniele Varrazzo
a01700d478
Fixed test suite execution as a script
...
Don't know why I changed the defaultTest argument into a function when I
converted the test suite into a package: that argument should be really
a string.
2011-01-03 20:45:03 +01:00
Daniele Varrazzo
39dd577c90
Use the proper printf placeholders to avoid warnings on 64 bit builds
2011-01-03 20:44:57 +01:00
Daniele Varrazzo
68305a0eb6
Fixed TYPE adaptation to basic tuples
...
Tuples and namedtuples have different constructors.
2011-01-03 19:27:26 +01:00
Daniele Varrazzo
b276e3b05d
Fixed compiling on Python versions before 2.6
...
Added a few macros not defined in Py 2.4. Don't know about 2.5.
2011-01-03 19:18:50 +01:00
Daniele Varrazzo
9eae66e8cf
Added Py3 compatibility macro for Py_TPFLAGS_HAVE_WEAKREFS
2011-01-03 16:56:26 +01:00
Daniele Varrazzo
929d62053a
Merge branch 'python2' into python3
...
Conflicts:
NEWS-2.3
setup.py
2011-01-02 03:28:00 +01:00
Daniele Varrazzo
7e9be4c133
Added Python 3 trove classifier.
2011-01-02 03:26:31 +01:00
Daniele Varrazzo
3cc8719998
Added missing test to the test suite.
2011-01-02 03:00:44 +01:00
Daniele Varrazzo
17f69ba735
Fixed Makefile dependencies of the test suite.
2011-01-02 03:00:32 +01:00
Daniele Varrazzo
afb87bb10a
Fixed "building" of purelib files with make.
...
Using build instead of build_py forced build_ext to run too, which may
fail to run as the option PG_CONFIG is not passed (or, worse, we may end
up building against the wrong pg_config).
Also touching the target file as make seems considering the source file
newer than the destination when the timestamp is the same (as it is
because the file is usually just copied).
2011-01-02 02:44:56 +01:00
Daniele Varrazzo
d08bfcbee5
Refuse to build if pg_config is not found.
...
I think half of the problems in OS X setup are due to setup going ahead
even when the pg_config is not found. We are now only building with PG
version that make the tool available.
2011-01-02 02:01:53 +01:00
Daniele Varrazzo
88bb8eda3e
None/IN adaptation ported to Python 3.
2011-01-02 00:44:14 +01:00
Daniele Varrazzo
45c6dfb69d
Merge branch 'adapt-type' into python2
2011-01-02 00:35:59 +01:00
Daniele Varrazzo
7ac0bdd661
Added PostgreSQL composite types typecaster to Python tuples.
2011-01-02 00:34:13 +01:00
Daniele Varrazzo
159cda3688
Added cursor.cast() method
...
The method exposes the typecasters lookup algorithm. Useful to create
recursive typecasters.
2011-01-01 22:55:10 +01:00
Daniele Varrazzo
3e94375cf7
Merge branch 'python2' into python3
...
Conflicts:
ChangeLog
NEWS-2.3
lib/extensions.py
psycopg/microprotocols.c
setup.py
2011-01-01 17:14:54 +01:00
Daniele Varrazzo
f9be48d89e
Merge branch 'none-in-composite' into python2
2011-01-01 17:09:37 +01:00
Daniele Varrazzo
fdfa2de1a1
Fixed adaptation of None in composite types (ticket #26 ).
...
Added an adapter for None: it is usually not invoked as adaptation to
NULL is a fast path in mogrify, but can be invoked by composite types.
Notice that composite types still have the option to fast-path None
(e.g. list adapter does).
2011-01-01 17:07:54 +01:00
Daniele Varrazzo
506ce93a5b
Bump to the next dev version.
2011-01-01 12:55:41 +01:00
Daniele Varrazzo
30921b58a8
Dropped conversion from None to NULL in adapter.
...
It was an error as the string is not conform to the protocol. The error
is masked by the None fast path in _mogrify, but surfaces when adapting
a tuple contains a None.
2010-12-31 18:55:33 +01:00
Daniele Varrazzo
b5a8facb9c
Added test to show failed adaptation of None in records.
2010-12-31 18:54:50 +01:00
Daniele Varrazzo
ac25816962
Use the same Bytes_Format function for both Python 2 and 3.
...
This makes the behaviour between the two versions similar. It also have
the effect of a more specific error message in case an user specifies a
placeholder different from 's'.
2010-12-31 03:22:19 +01:00
Daniele Varrazzo
2930ed3d59
Dropped support for all format specifiers except s in PyBytes_Format.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
6882ac31d4
Dropped warnings in PyBytes_Format function.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
96a950d3eb
Fixed 2-phase commit support in Python 3.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
89fb60de4b
Column names in copy methods can be unicode.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
73917c15e1
Fixed COPY FROM to deal with decoded files.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
bc28cc8b00
Use unicode keys as strings in Py3.
...
This fixes pyformat style argument passing. Unicode and bytes don't
compare equal (even if they hash the same).
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
0a4eeb4e13
Fixed notification tests to run on Py3.
...
Call 2to3 on the dynamically generated scripts.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
b78ff4a273
Several tests ported to Python 3.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
2fa9117835
Inet adapter compatible with Python 3.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
c176de4bf8
Hstore adapter compatible with Python 3.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
89c492d3a4
Added b() function to return bytes in both Py2 and Py3.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
061079c918
In Py3, decode the tuple values before passing to the typecaster.
...
Not sure this is the best way to go: it is now impossible to write a
binary typecaster in Python; furthermore it is the opposite approach of
the codecs, which should return bytes.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
ab5934dc35
Use ascii_letters instead of letters.
...
The latter is locale-dependent and not available on Py3.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
01565fa6c5
Added tests to verify a couple of incomplete encodings.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
f6fefbea64
Function psycopg_ensure_bytes converted in a "filter" stealing a ref.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
3214c23f51
Fixed adaptation in several adapters.
...
The getquoted methods always return bytes. The str() convert this
representation to string on the fly.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
2e22eef727
Added utility function to convert bytes to string in Python 3.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
d3f3f1caf0
Added utility method to return a string in the connection encoding.
...
In Py2 the result is plain string, in Py3 an unicode decoded in the
connection encoding.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
60841c6567
Added regression test on bool adaptation.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
beba064983
Test on basic adapters pass on Python 3.
2010-12-31 03:18:26 +01:00
Daniele Varrazzo
56e4c2bd55
Redefining the microprotocol on Py3 as returning bytes.
2010-12-31 03:18:26 +01:00
Daniele Varrazzo
014b6a6d5b
Use psycopg_ensure_bytes() to unify Py2/3 code paths.
2010-12-31 03:18:26 +01:00
Daniele Varrazzo
89e4d4c7bb
Empty lists correctly roundtrip.
2010-12-31 03:18:26 +01:00
Daniele Varrazzo
b5ef5ef21d
Added typecasters repr().
2010-12-31 03:18:26 +01:00
Daniele Varrazzo
b4685bba4a
Added utility function to get bytes from a str/unicode.
2010-12-31 03:18:26 +01:00
Daniele Varrazzo
03dde732f6
Datetime adaptation in bytes.
2010-12-31 03:18:26 +01:00
Daniele Varrazzo
87a7ebac10
Query mogrification in bytes.
2010-12-31 03:18:26 +01:00
Daniele Varrazzo
c3196ebd9d
Added PyBytes_Format function.
2010-12-31 03:18:26 +01:00
Daniele Varrazzo
e18f1c63ea
Deal with slices passed to __*item__ in Python 3.
2010-12-23 03:28:19 +01:00
Daniele Varrazzo
ade1b2cc7b
Test suite converted into a proper package.
...
Dropped cyclic import from modules to tests: they were only working
because a second copy of the package was found in the project dir.
Use relative import so that 2to3 can do a good conversion.
2010-12-21 05:02:19 +00:00
Daniele Varrazzo
f697410ab4
The tests are run from the external of the package.
...
If __init__ is treated as a script, relative import fail.
2010-12-21 04:49:16 +00:00
Daniele Varrazzo
cb6b52945b
The library can be compiled with Python 3.
...
Just compiled! No test run yet and many points to review, marked in the
code.
The patch is largely Martin von Löwis work, simplified after refactoring
in the previous commits and adapted to the new code (as the patch was
originally for Psycopg 2.0.9)
2010-12-21 04:24:36 +00:00
Daniele Varrazzo
e182201e6e
Added Python codec name to the connection.
...
This allows dropping repeated dictionary lookups with unicode
query/parameters.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
ae06fb03e7
Added psycopg_strdup utility function.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
a50a91fc7b
No need to put connection fields to zero: tp_alloc already did.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
7b5d80d36d
Added a few missing encodings.
...
EUC_CN, EUC_JIS_2004, ISO885910, ISO885916, LATIN10, SHIFT_JIS_2004.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
657bcb4828
Encodings mapping reordered in a more maintainable order.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
b96dcef8a2
Fixed PG -> Py encodings mapping with non-alnum chars.
...
We mangle the encoding names a little bit before asking it to the
backend: be sure to be able to find the equivalent Python code back or
decoding (unicode cast or Py3) will barf.
2010-12-21 04:02:14 +00:00
Daniele Varrazzo
4635c2aa4f
Import structmember/stringobject headers from python.h.
...
stringobject is not to be imported with Python 3.
2010-12-21 04:02:13 +00:00
Daniele Varrazzo
9b30147341
Using PyVarObject_HEAD_INIT macro.
2010-12-21 04:02:13 +00:00
Daniele Varrazzo
8dfa9915eb
Using Py_TYPE and Py_REFCNT macros.
2010-12-21 04:02:13 +00:00
Daniele Varrazzo
2196ff5488
Added a few compatibility macros defined in Py 2.6.
2010-12-21 04:02:13 +00:00
Daniele Varrazzo
9b29282ee4
'make check' runs the test in the build directory.
...
This way tests can be run win Py3 too, as the setup 2to3s them.
2010-12-21 04:02:13 +00:00
Daniele Varrazzo
31093a7a58
Some light cleanup for Py3 conversion.
...
Either flagged as warning by python2.6 -3 or converted by 2to3.
2010-12-21 04:02:13 +00:00
Federico Di Gregorio
69c66a3a3f
Preparing release 2.3.2
2010-12-20 13:33:21 +01:00
Daniele Varrazzo
ddd2de0410
Updated ChangeLog/NEWS after ticket #24 patch commit.
2010-12-18 15:38:56 +00:00
Marti Raudsepp
a08419406c
Don't segfault when PQparameterStatus(DateStyle) returns NULL
...
pgbouncer for example does not pass on DateStyle.
2010-12-18 15:27:15 +00:00
Daniele Varrazzo
5a0cfad95f
Bump to next dev version.
2010-12-18 15:25:53 +00:00
Daniele Varrazzo
a30e461038
The Makefile can run with both Python 2 and 3.
2010-12-12 16:20:02 +00:00
Daniele Varrazzo
8a1fa9d3a0
setup.py compatible with both python 2 and 3.
2010-12-12 15:08:28 +00:00
Daniele Varrazzo
ec182e818e
Added list of files the extension depends on.
2010-12-12 14:38:25 +00:00
Daniele Varrazzo
89f70bdb3c
Changed Python const RO -> READONLY.
2010-12-12 13:39:32 +00:00
Daniele Varrazzo
6d7916cfe1
Internal imports simplified.
...
.c files only need to import psycopg.h: it will in turn import
dependencies from Python and libpq and configure.h. psycopg.h should be
the first to be imported, so the basic imports are not required in
the .h's
As a guideline I'm trying to import from the most specific to the most
generic to detect missing imports in the .h's.
2010-12-12 13:39:32 +00:00
Daniele Varrazzo
9fa1eac2b4
Dropped unused include file.
2010-12-12 13:39:32 +00:00
Daniele Varrazzo
0fbbd1cc91
Bump to next dev version.
2010-12-12 13:39:32 +00:00
Daniele Varrazzo
cf243ccf37
Shorter "never ending query" to test query canceling.
...
If the cancel signal misses the race, this query will stay in the
backend until the sleep expires.
2010-12-04 23:21:16 +00:00
Daniele Varrazzo
13c2f5a78b
Added target to package the docs for PyPI documentation.
2010-12-04 23:14:03 +00:00
Daniele Varrazzo
9e9933faed
Update classifier URLs for PyPI.
2010-12-04 23:14:03 +00:00
Federico Di Gregorio
ee5015a30b
Preparing release 2.3.1
2010-12-04 21:24:02 +01:00
Daniele Varrazzo
557e28d744
Dropped interface for two private functions.
...
Note: the functions are private because typecast.c imports the .c's of
typecast_[mx]datetime, not the .h's.
Work around the warning for 'skip_until_space' not used with an #ifdef.
Furthermore, those functions are now static.
2010-12-04 13:51:21 +00:00
Daniele Varrazzo
288f9ee809
Work around CentOS 5.5 x86_64 buld problem.
...
Closes ticket #23
2010-12-04 13:51:21 +00:00
Daniele Varrazzo
ebd73c14a8
Going to dev version for 2.3.1.
2010-12-04 13:43:28 +00:00
Daniele Varrazzo
9c71a9c6e5
Added link to psycogreen.
2010-12-02 17:13:13 +00:00
Daniele Varrazzo
bde523695a
Fixed index entries of green-related terms.
2010-12-02 15:15:31 +00:00
Daniele Varrazzo
4bd8f8c76b
Typo/tenso fixed.
2010-12-02 15:07:17 +00:00
Daniele Varrazzo
593cd20b4a
Added index entries under Adaptation for different objects.
2010-12-02 15:06:27 +00:00
Federico Di Gregorio
2dae07a796
Preparing release 2.3.0
2010-12-02 14:41:58 +01:00
Daniele Varrazzo
46a5f140c7
Bail out early from tests if connection to the test db fails.
2010-12-01 20:56:25 +00:00
Federico Di Gregorio
5f80dd38c4
Removed runtests target; checks is the default for Makefiles
2010-12-01 21:55:42 +01:00
Federico Di Gregorio
a411f85354
Removed default test database from Makefile
...
The default is already in test/__init__.py and the Makefile was
overwriting the PSYCOPG2_TESTDB env variable.
2010-12-01 21:29:33 +01:00
Federico Di Gregorio
f981e81813
Merge remote branch 'piro/python2' into python2
2010-12-01 19:47:44 +01:00
Daniele Varrazzo
6688e7011c
Typos fixed in the news.
2010-12-01 13:21:16 +00:00
Daniele Varrazzo
0ad7483a2b
DictRow items can be updated. Patch by Alex Aster.
2010-12-01 13:17:12 +00:00
Daniele Varrazzo
6f2d40405e
Added documentation for ISQLQuote.prepare().
2010-11-28 18:26:30 +00:00
Daniele Varrazzo
361786f4a8
More careful connections handling during tests.
2010-11-28 17:29:37 +00:00
Daniele Varrazzo
598b9424d2
Deal uniformly with test servers without pg_sleep.
2010-11-28 17:29:36 +00:00
Daniele Varrazzo
2b6d2017ed
Added paranoia test to check we haven't broken gil release.
...
Got scared testing cancel with a signal as it doesn't work. But probably
signals are not deliveded to Python in the middle of an opcode.
2010-11-28 17:29:35 +00:00
Daniele Varrazzo
0c7b0a943b
A prepared connection can't be canceled.
2010-11-28 12:15:26 +00:00
Daniele Varrazzo
4dbd4344a3
Mention query cancelling in the release notes.
2010-11-28 12:14:04 +00:00
Jan Urbański
751bfa1ea6
Support query cancellation.
...
Add a cancel() method do the connection object that will interrupt
the current query using the libpq PQcancel() function.
2010-11-28 11:50:02 +00:00
Daniele Varrazzo
9f78141532
Don't consider the kernel not blocking us on write as an error.
2010-11-25 03:13:49 +00:00
Daniele Varrazzo
5a025825cc
Skip test if uuid not available on Python.
2010-11-24 11:04:18 +00:00
Daniele Varrazzo
bb44bcd5b5
Skipped inf test on the platform not supporting it (win32).
2010-11-24 10:50:28 +00:00
Daniele Varrazzo
1fd6b84068
Added test suite to the distributed package.
2010-11-24 03:36:57 +00:00
Daniele Varrazzo
fdf1ba1aac
Dropped notices hack to get COPY errors from V2 protocol.
2010-11-22 00:49:07 +00:00
Daniele Varrazzo
7fe7b669aa
Added instructions about running tests and building docs.
2010-11-20 01:14:41 +00:00
Daniele Varrazzo
6f51eefac3
Dropped references to psycopg 1 from readme and install.
...
Nowaday not many remember it: I think it's useless to make comparisons.
2010-11-20 01:14:05 +00:00
Daniele Varrazzo
ed3b2188fe
Fixed import of test functions from Python 2.7 unittest.
2010-11-19 18:01:29 +00:00
Daniele Varrazzo
bbe28ba75f
Add a small delay to receive notification when testing on busy network.
2010-11-19 14:44:47 +00:00
Daniele Varrazzo
f2c5d04f39
Fixed docs: the execute argument must be a sequence, not a tuple.
2010-11-19 13:13:14 +00:00
Daniele Varrazzo
21dfc2c592
Float test skipped where the server doesn't support inf.
2010-11-19 10:44:39 +00:00
Daniele Varrazzo
a55e50b991
hstore test passes against non-utf8 databases.
2010-11-19 10:29:07 +00:00
Daniele Varrazzo
19ead4a5cb
Test cleanup.
...
Tests pass or fail gracefully on older PostgreSQL versions.
If unittest2 is available, skip tests instead of printing warnings.
2010-11-19 03:55:37 +00:00
Daniele Varrazzo
94348bfb78
hstore registration doesn't fail if typarray column not available.
2010-11-19 03:51:53 +00:00
Daniele Varrazzo
163cf5bfb4
mx.DateTime module initialized as it is supposed to be.
...
No need to pass the api pointer around. Dropped compiler warnings.
2010-11-19 00:28:49 +00:00
Daniele Varrazzo
3e3aa676a9
datetime module initialized as it is supposed to be.
...
Dropped compiler warnings. It wouldn't blow up if any api was called.
No need to pass type pointers around.
2010-11-19 00:28:39 +00:00
Daniele Varrazzo
576b01f6a3
Functions exported to drop warnings.
2010-11-19 00:20:49 +00:00
Daniele Varrazzo
67793ed989
Compiler warning dropped.
2010-11-18 23:13:16 +00:00
Daniele Varrazzo
bcacdc8461
Added enum with possilbe isolation level states.
...
Also, general isolation levels cleanup and tests added.
2010-11-18 00:31:51 +00:00
Daniele Varrazzo
4074635629
Moved links to PG docs from 8.4 to 9.0.
2010-11-17 23:05:10 +00:00
Daniele Varrazzo
454c6b8915
Moved links to PG docs from 8.4 to 9.0.
2010-11-17 02:59:03 +00:00
Daniele Varrazzo
c3c54aab38
Don't clobber exception if conn_switch_isolation_level fails.
...
Which shouldn't.
2010-11-17 01:43:50 +00:00
Daniele Varrazzo
9849083628
Added tests to check the effective isolation level.
2010-11-17 01:04:34 +00:00
Daniele Varrazzo
e1a04bec0e
Don't inconditionately run a query at connection to set datestyle to ISO.
...
Run it only if PQparameterStatus() reports the datestyle is set to
something different.
2010-11-16 18:15:00 +00:00
Daniele Varrazzo
15bba2966f
Don't run a query at connection to detect client encoding.
...
Use PQparameterStatus() instead. This is only guaranteed in protocol 3.
2010-11-16 10:16:52 +00:00
Daniele Varrazzo
a88d7ab424
Dropped support for protocol 2.
...
Dropped both the setup constant allowing conditional compiling and the
code specific to V2 protocol (mostly COPY and error handling).
2010-11-16 01:08:50 +00:00
Daniele Varrazzo
73265e7ece
Refuse connection with server with protocol version 2.
...
This cuts off server whose version is older than 7.4. But enables us to
remove large portions of code rarely used and tested (e.g. p2 copy) and
will allow us to drop the query we do at each connection to establish
the client encoding and the datestyle.
2010-11-16 01:01:32 +00:00
Daniele Varrazzo
58079c6c91
Fixed dependencies of the sdist target
2010-11-15 09:35:28 +00:00
Daniele Varrazzo
0a2856477c
The Makefile can receive the pg_config location.
2010-11-14 18:23:09 +00:00
Daniele Varrazzo
b25af6311c
Makefile included in sdist.
2010-11-14 02:18:57 +00:00
Daniele Varrazzo
78dfbfb94a
Fixed dependencies to build the docs.
2010-11-13 20:31:53 +00:00
Daniele Varrazzo
d07791cfe9
Fixed setuptools installation from scratch.
2010-11-13 20:01:48 +00:00
Daniele Varrazzo
988861a2d8
runtests.py script dropped.
...
It was broken as the distutils changed the name of the build dir
somewhere along the way. Use ``make runtests`` instead.
2010-11-13 19:50:25 +00:00
Daniele Varrazzo
9ffcb90038
Added flesh to the Makefile.
...
Now it can be used to build, make the docs (including installing
dependencies), run the tests, build the sdist.
2010-11-13 19:45:45 +00:00
Jean-Baptiste Quenot
b8ce51d9c2
Mention connection object in debug logs
2010-11-13 03:56:23 +00:00
Daniele Varrazzo
cd19f9115d
Fixed notices order (ticket #9 ).
2010-11-11 11:54:43 +00:00
Daniele Varrazzo
3cae0f3f5d
NamedTupleCursor doesn't change exception when fetching with no result.
2010-11-11 10:39:42 +00:00
Daniele Varrazzo
ef7a5ee8a9
Build the namedtuple only once per execution, not once per fetch.
2010-11-11 10:39:42 +00:00
Daniele Varrazzo
11c021cb21
Fixed tests to run on Windows.
2010-11-11 10:39:35 +00:00
Daniele Varrazzo
92ee893f0f
Functions unused outside the module marked static.
2010-11-10 15:50:05 +00:00
Federico Di Gregorio
cf07af5ff5
Version bump to 2.3.0-beta2
2010-11-09 18:51:46 +01:00
Daniele Varrazzo
a39e98f9e5
Check the presence of a mro.
...
The mere presence of the Py_TPFLAGS_HAVE_CLASS doesn't ensure it is
there.
2010-11-09 14:28:00 +00:00
Daniele Varrazzo
f0773d5682
Avoid pointless string manipulation in NamedTupleCursor.
...
Closes ticket #10 . Reported by Marko Kreen.
2010-11-09 11:17:02 +00:00
Daniele Varrazzo
ed6a4c8b1a
Dropped PyArg_ParseTuple() calls in functions taking no arguments.
2010-11-09 03:18:54 +00:00
Daniele Varrazzo
2dc28ee7d8
Less lookups and more efficient calls in microprotocols_adapt().
...
Also more explicit handling of the exception indicator.
2010-11-09 02:41:43 +00:00
Daniele Varrazzo
753b580d72
Less lookups and more efficient calls in microprotocols_getquoted().
2010-11-09 02:21:21 +00:00
Daniele Varrazzo
422fede38e
Replaced PyObject_CallFunction() with *ObjArgs() where more efficient.
2010-11-09 01:49:22 +00:00
Daniele Varrazzo
9fe0511711
Silencing other 2 tests failures due to 2pc disabled in the server.
2010-11-09 01:44:42 +00:00
Jason Erickson
c79d20855a
Win32 *time_r fix
...
Fixed the thread safetyness of the Windows *time_r functions.
2010-11-09 00:20:58 +00:00
Daniele Varrazzo
d601ab8239
fixed crash in pdecimal_str with a few Python 2.5.x releases.
...
is_finite() is not available in 2.5.1, it is in 2.5.5 but is officially
supported only since 2.6.
2010-11-09 00:14:22 +00:00
Daniele Varrazzo
0d318179a9
Fixed test syntax for py 2.4.
2010-11-09 00:09:32 +00:00
Daniele Varrazzo
af3681cc1c
Fixed repr for Decimal wrapper.
2010-11-09 00:09:19 +00:00
Daniele Varrazzo
916c172cf7
Dropped file imported by mistake.
2010-11-09 00:09:09 +00:00
Daniele Varrazzo
62d3a1533b
Use the adapter of an object superclass if available.
2010-11-08 01:35:06 +00:00
Daniele Varrazzo
225b276de5
Use faster function to build tuples in adaptation.
...
Fixed a refcount bug too.
2010-11-08 01:28:01 +00:00
Daniele Varrazzo
df05ea7a33
Py_TYPE defined as it is in Python 2.6.
2010-11-08 01:28:01 +00:00
Daniele Varrazzo
b9e96dbbd2
Added version info to Xid object docs.
2010-11-08 01:28:01 +00:00
Daniele Varrazzo
2f582da1f0
Notifcation example improved.
2010-11-08 01:28:00 +00:00
Daniele Varrazzo
7276c4a6b1
Tests fail gracefully if tpc is supported but disabled by the server.
2010-11-08 01:28:00 +00:00
Federico Di Gregorio
645ab521f3
Preparing release 2.3.0-beta1
...
* Merged NEWS-2.3 and NEWS-2.2: 2.0 (pre-async) still makes sense in case
someone has horrible problems with the new code but 2.3 will just
substitute 2.2 so having a separated NEWS file doesn't make sense.
* Moved authors and contributors to AUHTORS file.
* README now has pointers to web site and bug tracker.
* Updated MonoDevelop project.
2010-11-06 15:50:39 +01:00
Daniele Varrazzo
4ea9dbdcf0
Typo fixed
2010-11-06 04:40:47 +00:00
Daniele Varrazzo
abad3127ca
Added NamedTupleCursor.
2010-11-06 04:33:44 +00:00
Daniele Varrazzo
985425fb38
Added test to verify the ticket #7 is fixed.
2010-11-06 02:24:28 +00:00
Daniele Varrazzo
5b65e75122
Docs expansions about thread/processes safety.
2010-11-05 23:58:10 +00:00
Daniele Varrazzo
4125b3fce0
Added compatibility macro for pre 2.6
2010-11-05 12:59:32 +00:00
Daniele Varrazzo
04b4649d03
Updated version 2.2.3 -> 2.3 in the docs.
2010-11-05 12:38:49 +00:00
Daniele Varrazzo
ee71e52269
Added news file for new release.
2010-11-05 10:07:25 +00:00
Daniele Varrazzo
40377a18af
Updated classifier to make the upload work.
2010-11-05 10:06:54 +00:00
Daniele Varrazzo
274ff8bb1d
Dropped reference to removed TODO file: it breaks 'pip'.
2010-11-05 09:40:02 +00:00
Daniele Varrazzo
d6cdc1c7b6
Bump to 2.3.dev0
2010-11-05 09:34:53 +00:00
Daniele Varrazzo
2480f587e1
Added warning note about equivalence inconsistence between Notify and tuples.
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
77c0ab02d8
The Notify type is hashable.
...
If there is no payload, hash the same way the equivalent 2-tuple does.
Otherwise hash on the payload too.
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
56ae1fe4bf
Payload default is the empty string.
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
9c58c01e0f
Added comparison between Notify objects and Notify or tuple.
...
Explicit comparison with the tuple is required if we want to make
Notify() == (pid, channel) work: item access is not enough (and a test
in the suite fails if we get this wrong).
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
6cb949d371
Try to install the hstore type in the test database.
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
1b100b5cbf
Skip tests if the hstore type is not in the test database.
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
01ec120aa8
Hstore documentation improved.
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
4b98e8941f
Added some documentation for the hstore adaptation.
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
d5bf400cb4
The hstore typecast can be registered globally.
2010-11-05 09:34:52 +00:00
Daniele Varrazzo
bb41acd1da
Favour the PG9 implementation of the hstore adapter.
2010-11-05 09:34:51 +00:00
Daniele Varrazzo
ed623776f3
Hstore can return unicode keys and values.
2010-11-05 09:34:51 +00:00
Daniele Varrazzo
00e005b77d
Added test to verify dict roundtrip with hstore.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
af835f8857
Correctly parse escaped quotes from hstore.
...
Parse regexp simplified.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
70880dde79
Added special cases to store empty dicts.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
6d441b6e03
Added hstore typecaster registration.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
fef9727cce
parse_hstore converted in class method.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
5844e989c4
Added function to parse an hstore into a dict.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
5693c9cab1
Added implementation of python dict adapter to hstore.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
90e0e2f47d
Added documentation for the Xid object.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
3e658c33b5
Ensure unicode is accepted as type for transaction ids.
...
We don't do somersaults to ensure people can use snowmen as transaction
ids anyway: it would require passing the connection to xid_ensure and
down below to use the correct encoding.
2010-11-05 09:34:50 +00:00
Daniele Varrazzo
4f3976681a
Added Xid.from_string() constructor.
...
It exposes the parsing rules used in restore.
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
2f29429e88
Expose the Xid object in the extension module.
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
f0f5f095c7
Fixed handling of commit/rollback prepared in green mode
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
a923a16ae8
Added two-phase commit docunetation.
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
5dbeeba0f2
Raise NotSuppoertdError if tpc is used with PostgreSQL < 8.1
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
ab8e145063
Encoding/decoding in base64 refactored.
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
3312897e5d
Added str() and repr() for Xid objects.
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
4fdcfe365c
xid_get_tid returns a Python string, not a buffer.
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
774be1d616
Dropped XID_UNPARSED: we use format_id = None for PG xact ids.
2010-11-05 09:34:49 +00:00
Daniele Varrazzo
978cac3a1b
XA transaction ids can be decoded from PostgreSQL transaction ids.
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
6309e038e5
Dropped pg_xact_id from XidObject
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
c0c116dcc4
Use pgjdbc algorithm to convert XA xids into strings.
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
17d70babb1
Keep the GIL while converting the xid into the PostgreSQL transaction id.
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
397eace051
Added tests for two-phase commit/rollback.
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
56c02b0f94
Added tpc_recover method.
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
09983db6ed
Added tpc_commit and tpc_rollback methods.
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
4f66de494b
Added tpc_prepare and CONN_STATUS_PREPARED.
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
4588fa50f2
begin and commit can't be called during a two-phase transaction.
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
98c5b1d374
Added tpc_begin() and current xid on connection.
2010-11-05 09:34:48 +00:00
Daniele Varrazzo
60ee39fa3d
Copyright of TPC files moved to LGPL V3.
...
With the permission of James Henstridge.
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
8bfd34faf2
hook up two phase commit tests.
...
By James Henstridge on 2008-07-24.
Merged from lp:~jamesh/psycopg/two-phase-commit/revision/359
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
7a9d678050
There is no point in allowing subclasses of Xid.
...
By James Henstridge on 2008-07-24.
Merged from lp:~jamesh/psycopg/two-phase-commit/revision/358
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
22aea9114b
implement sequence behaviour, as required for transaction IDs.
...
By James Henstridge on 2008-07-24.
Merged from lp:~jamesh/psycopg/two-phase-commit/revision/357
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
0021e56d80
Added connection.xid() and related objects.
...
By James Henstridge on 2008-07-23.
Merged from lp:~jamesh/psycopg/two-phase-commit/revision/356
* psycopg/connection_type.c (psyco_conn_xid): add a
Connection.xid() method that instantiates Xid objects.
* psycopg/psycopgmodule.c (init_psycopg): initialise the Xid
object type.
* psycopg/xid.h:
* psycopg/xid_type.c: Implement a basic transaction ID object for
use in two phase commit.
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
e863222b5c
beginnings of a TPC test harness
...
By James Henstridge on 2008-05-12.
Merged from lp:~jamesh/psycopg/two-phase-commit/revision/354
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
1a0fca09d9
Added documentation for the Notify object.
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
4ec298e112
Notify object exposed in the extensions module.
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
8db9c7085d
Added repr method for Notify object.
2010-11-05 09:34:47 +00:00
Daniele Varrazzo
f435d15c95
Adding Notify object with payload.
2010-11-05 09:34:46 +00:00
Daniele Varrazzo
e651308287
Check the correctness of the PID in the notify tests.
2010-11-05 09:34:46 +00:00
Daniele Varrazzo
d9e49e940a
Fixed versionchanged note on fractional time zone.
2010-10-31 23:57:40 +00:00
Daniele Varrazzo
7e482756c5
Use PQfreemem to free memory allocated by the libpq.
...
Bug reported by Anton Kovalev.
2010-10-08 14:26:40 +01:00
Daniele Varrazzo
6e71b3db05
Dropped PSYCOPG_OWN_QUOTING.
...
It was deprecated for version 2.1. There are bugs to be fixed made more
complex by its presence and it doesn't keep into account PostgreSQL 9.0
new binary format.
Time to go!
2010-10-08 12:27:47 +01:00
Daniele Varrazzo
baf65a0dda
Fixed access to freed memory in conn_get_isolation_level().
...
Bug reported by Anton Kovalev.
2010-10-08 12:02:53 +01:00
Daniele Varrazzo
850cd97ab3
A few doc fixes.
2010-10-08 10:16:59 +01:00
Daniele Varrazzo
bc2aefeacf
cursor.mogrify() accepts unicode queries.
2010-10-05 03:13:44 +01:00
Daniele Varrazzo
5b4d366f4e
Common code in execute() and mogrify() merged.
2010-10-05 01:43:23 +01:00
Daniele Varrazzo
575b2b5f77
The Inet type knows how to adapt itself.
...
Implemented __conform__ as the Adaptation PEP suggests. It is not
required for the type to be registered as adapter.
2010-09-25 23:55:55 +01:00
Daniele Varrazzo
75a6f783c5
Added PostgreSQL 9.0 error codes.
2010-09-23 23:43:23 +01:00
Daniele Varrazzo
b072a04c9c
DBAPI compatibility test updated to 1.12.
...
Nothing major: Python 3.0 compatibility fixes.
2010-09-23 23:36:58 +01:00
Daniele Varrazzo
2081ceffde
Don't execute a ROLLBACK on close()/GC.
...
The command wasn't sent since 2.2.0 due to a bug, but after a ML
discussion this behaviour proved more correct so the bug has become a
feature.
2010-09-23 23:28:30 +01:00
Daniele Varrazzo
cb1ef242a0
Bump to version 2.2.3-devel.
2010-09-23 23:27:55 +01:00
Daniele Varrazzo
bf9e557a71
Fixed typo in docs.
2010-09-23 23:17:32 +01:00
Daniele Varrazzo
19ae49e79e
Refer to PostgreSQL 9.0 documentation.
2010-09-23 23:14:39 +01:00
Daniele Varrazzo
80ebb14df4
Use stable anchors to reference PostgreSQL docs.
2010-09-23 23:13:59 +01:00
Daniele Varrazzo
9b3aa290d2
Added missing import required by Sphinx 1.0.
2010-08-05 01:08:21 +01:00
Daniele Varrazzo
660b75c2f4
Typo fixed.
2010-08-04 23:26:52 +01:00
Federico Di Gregorio
c3b835929b
Preparing release 2.2.2
2010-07-18 12:32:45 +02:00
Federico Di Gregorio
557608f715
Applied spelling fixes patch from Peter Eisentraut
2010-07-18 12:14:46 +02:00
Federico Di Gregorio
b263fbf274
Added deprecation warning to register_tstz_w_secs
2010-07-13 14:26:52 +02:00
Daniele Varrazzo
deb2d9050f
Exceptions raised by the columns iterator propagated.
2010-07-10 00:12:50 +01:00
Daniele Varrazzo
cb8128c6d4
Added test to verify copy_from() with columns.
2010-07-10 00:04:54 +01:00
Daniele Varrazzo
927f2bb1f1
Dropped logging.basicConfig() call.
...
It messes up with projects using logging but where no handler is
installed on the root logger. Bug reported by Joe Abbate.
2010-07-09 23:23:10 +01:00
Daniele Varrazzo
3773b50bb3
Propagate iterable exceptions to the executemany caller.
2010-07-09 23:22:35 +01:00
Daniele Varrazzo
bd6a4139da
Added test to verify executemany doesn't propagate exceptions.
2010-07-09 15:23:02 +01:00
Daniele Varrazzo
4a78e4068b
Dropped register_tstz_w_secs() implementation.
...
The function is no-op now that the default type caster can deal with
seconds in the tz offset.
2010-05-20 02:18:04 +01:00
Daniele Varrazzo
305d86f38a
Handle time zones with seconds in the UTC offset.
...
The offset is rounded to the nearest minute.
2010-05-20 02:16:04 +01:00
Daniele Varrazzo
e3d489f701
Bump to version 2.2.2-devel.
...
The -devel suffix appears in the docs we publish on the website, so it's
clear that they refer to the upcoming version.
2010-05-20 02:03:07 +01:00
Daniele Varrazzo
eacf6febfe
Warn on declarations not at beginning of the block.
...
They are accepted by gcc but not by MS compilers.
2010-05-19 11:40:38 +01:00
Daniele Varrazzo
b597ccf917
Tests can be run again different coroutine libraries.
...
Use PSYCOPG2_TEST_GREEN=<something>, where <something> is 1 or a library
name. Currently eventlet is supported.
2010-05-19 11:40:13 +01:00
Federico Di Gregorio
23391a3c55
Preparing release 2.2.1
2010-05-17 21:51:25 +02:00
Jason Erickson
069695b4ae
Additional Library for Windows linking and OpenSSL 1.0.0
...
Added the linking of crypt32.lib to the windows SSL build, as it seems that the current version of OpenSSL is looking for crypt32.lib as well.
2010-05-17 09:06:29 +02:00
Jason Erickson
1f1133b871
Micrsoft Visual C Compile Fix
...
Moved the declarations of variables/pointers to the beginning of the block, where MSVC wants them.
2010-05-17 09:06:14 +02:00
Federico Di Gregorio
e286970b62
Preparing release 2.2.0
2010-05-16 12:55:59 +02:00
Federico Di Gregorio
6521fb5a44
Fixed error related to calling C typecasters from Python ones
2010-05-15 19:34:56 +02:00
Federico Di Gregorio
36cbefdee1
Updated project and version for release 2.2.0
2010-05-15 17:51:54 +02:00
Daniele Varrazzo
a35498532a
Fixed time test to be independent from the TZ it runs.
2010-05-15 14:27:24 +01:00
Daniele Varrazzo
c46a1dad63
Fixed TimeFromTicks for second values > 59.5.
2010-05-15 14:27:24 +01:00
Daniele Varrazzo
afea19651c
Fixed TimestampFromTicks for second values > 59.5.
...
Bug reported and fixed by Jozsef Szalay on 2010-05-06 at 14:11:59.999920.
2010-05-15 14:27:24 +01:00
Daniele Varrazzo
b04bf41f99
Fixed decimal to float recipe to avoid using FLOAT.
...
FLOAT seems not working with NULLs.
2010-05-15 14:27:24 +01:00
Daniele Varrazzo
5e3f240ac9
Cast datetime into timestamptz when the tzinfo field is set.
2010-05-15 14:27:23 +01:00
Daniele Varrazzo
60e7522e47
Added evaluable representation for the FixedOffsetTimezone object.
2010-05-15 14:27:23 +01:00
Daniele Varrazzo
d30daac782
Fixed typo in LocalTimezone doc.
2010-05-15 14:27:23 +01:00
Daniele Varrazzo
bf1c76b792
Explicit cast of the SQL representation of time-related objects.
...
Allow the objects to be recognized as the proper type by Postgres in not
strong contexts: problem reported by Peter Eisentraut.
Added tests to check the types are respected in a complete Py -> PG ->
Py roundtrip without context.
2010-05-15 14:27:23 +01:00
Daniele Varrazzo
e8c2a14362
Added typecasters for arrays of specific MX/Py time-related types.
2010-05-15 14:27:23 +01:00
Daniele Varrazzo
c8aef26e15
Adapt buffer objects using an explicit cast on the string literal.
...
Don't rely on Postgres casting the literal according to the context:
this doesn't work e.g. passing the object as function argument where a
function with the same name but taking a text exists. It doesn't work
either when the object is in an ARRAY construct.
Added test to check the type is respected in a complete Py -> PG -> Py
roundtrip without context.
Bug and solution reported by Peter Eisentraut.
2010-05-15 14:27:23 +01:00
Daniele Varrazzo
2020790ba1
Typo fixed.
2010-05-15 14:27:02 +01:00
Daniele Varrazzo
73db6bee01
Keep the connection in blocking mode unless it is not async.
...
Dropped set/unset nonblocking mode for copy and lobject operations:
lobjects don't work in nonblocking mode so they will hardly be supported
in green/async branches. Support for copy is still feasible, but it
will be done in other code paths (called by poll).
2010-05-09 20:37:48 +01:00
Daniele Varrazzo
e29424a230
Dropped large object support when psycopg is in green mode.
...
Async mode and large object are not compatible, albeit I haven't found
an authoritative source yet.
2010-05-09 20:34:02 +01:00
Daniele Varrazzo
2596cf7125
Simplified psyco_wait() function interface.
2010-04-25 23:08:08 +01:00
Daniele Varrazzo
8efa1fa6af
Dropped compiling warning.
2010-04-25 23:08:08 +01:00
Daniele Varrazzo
dab098c1cb
Cleaned up documentation for connection status constants.
...
Dropped reference to unused/internal states.
2010-04-23 13:28:49 +01:00
Daniele Varrazzo
cb40342afa
poll implementation for async, sync and green connection unified.
2010-04-23 13:28:49 +01:00
Daniele Varrazzo
0da4befe78
Added function to advance the state after flush attempt.
2010-04-23 13:28:38 +01:00
Daniele Varrazzo
f3b3483df3
Added a function to advance the state after a read attempt.
...
Dropped calls to PQisBusy/PQconsumeInput in the connection code.
2010-04-23 13:24:36 +01:00
Daniele Varrazzo
e82d2be64b
More lenient test timeout for a slow (or busy) machine.
2010-04-23 13:24:35 +01:00
Daniele Varrazzo
1edbd16577
Dropped curs_get_last_result function.
...
The result is read from a pqpath function and put on the async_cursor by
a function that also checks for is presence and dismiss it after its
usage.
2010-04-23 13:24:35 +01:00
Daniele Varrazzo
a66de9808f
Added 'pq_get_last_result()' function.
...
The function reads the last result after an asynchronous query.
2010-04-23 13:24:35 +01:00
Daniele Varrazzo
5be0fc52ca
Reusable parts of the green polling refactored out.
...
The functions _conn_poll_connecting() and _conn_poll_query() will be
usable by the async connections too.
2010-04-23 13:24:35 +01:00
Daniele Varrazzo
df959c20be
Making sync and async connection setup somewhat more consistent.
2010-04-23 13:24:35 +01:00
Daniele Varrazzo
d915cb12a8
Functions to poll in ready state moved on the connection.
2010-04-23 13:24:35 +01:00
Daniele Varrazzo
9f5d835de6
Functions conn_poll_* renamed to conn_poll_connect_*.
...
These functions are used only during async connections, not for polling
afterwards.
2010-04-23 13:24:35 +01:00
Daniele Varrazzo
d2d1160260
Documentation about coroutines support reviewed.
2010-04-23 13:20:56 +01:00
Daniele Varrazzo
7af0bf0b54
Set the async_status to ASYNC_DONE after a query with wait callback.
...
Failing in doing that broke notifications reception.
The responsibility for changing the async_status has been moved to the
poll function: this is consistent with how the async branch is
implemented.
With this commit all the test suite passes in "green" mode.
2010-04-21 16:20:16 +01:00
Daniele Varrazzo
d71520db9a
Read the server version only after connection established.
2010-04-21 15:31:07 +01:00
Daniele Varrazzo
8fed0aa57d
Forbid COPY-related methods in green mode.
...
With the current implementation, at best they would silently block. They
actually hang everything.
Implementation posponed after some refactoring of the polling system,
because it will be probably possible to provide an implementation for
'poll()' during COPY which is good for both async and green modes.
2010-04-21 15:21:33 +01:00
Daniele Varrazzo
c1f0d4d46c
Read notifications when polling an idle sync connection.
2010-04-21 15:21:33 +01:00
Daniele Varrazzo
4bb0c3bdf6
Use the wait callback in the connection setup queries.
2010-04-21 15:21:33 +01:00
Daniele Varrazzo
0ec73a18b4
'pq_execute_command_locked()' calls the wait callback if set.
...
The function is called without holding the GIL. Because it is necessary
to execute the Python callback if set, we need to re-acquire the GIL and
tnen release it again. In order to correctly bookkeep the thread state,
the pointer of the _save variable is passed to the function.
2010-04-21 15:21:33 +01:00
Daniele Varrazzo
7a06c0455b
Try to restore the connection state after a wait callback error.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
a54932ee9c
Added documentation for the green features.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
127f92f9db
Changed 'psyco_wait()' to only take the connection.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
0dd5d3f1d9
Correctly flush async queries in 'green' mode.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
8ba0f00d21
Added 'get_wait_callback()' function.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
a7c41a0388
'pq_execute()' uses the user wait callback if provided.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
55270cab9f
'poll()' can raise a Python exception in case of error.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
442b3b2f6c
Added 'psyco_exec_green()' to replace 'PQexec' using the user-provided block function.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
6dd6bee217
Added async read support to 'connection.poll()'.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
1108172e4c
The test suite can be run against the green path.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
1607f89bb1
Avoid the locks dance when reading the connection socket number.
...
It is a fast and non critical operation, so the lock is not required.
Furthermore, called from the wait callback creates a deadlock.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
389ad08965
Use the wait callback during connection if set.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
04d66a6c82
Added poll implementation for sync connection with external wait.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
1446f046e9
Added wait callback and functions to deal with it.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
02a28ff028
Notifications are automatically read after each query.
...
Added tests for basic notifications process.
2010-04-21 15:09:14 +01:00
Daniele Varrazzo
12ef826d50
Dropped redundant call to conn_notice_process().
...
If the connection is sync, notices will be processed by pq_fetch()
downstream.
If the connection is async, here we have only sent the query: no result
is ready yet, and neither notices have had a chance to arrive: they will
be retrieved later by pq_is_busy().
Added tests to check the above statement don't break.
2010-04-21 15:09:14 +01:00
Daniele Varrazzo
bcfcea4b49
Fixed reference leak in notify reception.
2010-04-21 15:09:13 +01:00
Daniele Varrazzo
2af29b467d
Added missing points to the changelog.
2010-04-21 15:09:13 +01:00
Daniele Varrazzo
d8f4ed1a04
Fixed documentation and example for asynchronous notifications.
2010-04-21 15:09:13 +01:00
Daniele Varrazzo
6fecc36b7f
Connection method 'executing()' renamed to 'isexecuting()'.
2010-04-21 15:09:13 +01:00
Daniele Varrazzo
7ee09353ec
Connection method 'issync()' changed into the attribute 'async'.
2010-04-21 15:09:13 +01:00
Daniele Varrazzo
7cf52da969
Ensure to close the connections in the doctests to avoid deadlocks.
2010-04-21 15:09:13 +01:00
Daniele Varrazzo
ac6938a26a
Fixed async documentation after cursor.poll() dropped.
2010-04-21 15:09:13 +01:00
Jan Urbański
a57a9976b4
Fix the NOTIFY example to use the correct APIs
2010-04-21 15:09:13 +01:00
Jan Urbański
067161d5f3
Remove fileno() and poll() from cursors
...
Instead, the code should be using the fileno() and poll() methods of
the cursor's connection. Handle the case when poll() is called on an
already built connection as a request to poll the asynchronous query
(if there is one) and get NOTIFY events.
Update the tests to reflect that change, add a test for NOTIFY.
2010-04-21 15:09:13 +01:00
Daniele Varrazzo
b7327a349d
FAQs grouped in themes.
2010-04-21 15:09:13 +01:00
Jan Urbański
f06f557111
Add one more test for errors involving two cursors
2010-04-20 23:01:10 +01:00
Jan Urbański
c4ebc0f702
Handle errors in asynchronous queries.
...
Do it by keeping the reference to the last PGresult in the cursor and
calling pq_fetch() before ending the asynchronous execution. This
takes care of handling the possible error state of the PGresult and
also allows the removal of the needsfetch flag, since now after
execution ends the results are already fetched and parsed.
2010-04-20 23:01:01 +01:00
Federico Di Gregorio
249b3ef88f
Merged tests from piro and jan async fixes branches
2010-04-14 10:01:37 +02:00
Jan Urbański
5f4ef5da13
Make connection.executing() be True during an async connection attempt.
2010-04-14 10:00:37 +02:00
Jan Urbański
463724690c
Set the execution status to ASYNC_READ after flushing all output.
...
Without this a query that did not get flushed completely to the server
would cause cursor.poll() to always go into the curs_poll_send()
branch even if it was retuning ASYNC_READ.
Bug report by Daniele Varrazzo.
2010-04-14 09:56:44 +02:00
Jan Urbański
4574bde3a2
Check for possible errors from PQflush.
...
Noticed by Daniele Varrazzo.
2010-04-14 09:56:44 +02:00
Jan Urbański
61f890c317
Set the initial connection status to CONN_STATUS_SETUP.
...
Without it the changes in e79528f9aa1f7457573720fce5548302fefffd37 are
never used.
2010-04-14 09:56:44 +02:00
Jan Urbański
6108e4dc92
Make the first poll() of an asynchronous connection return POLL_WRITE.
...
This hides from the user the libpq's implementation detail of
requiring the first select() to wait for the connection socket to
become writable and makes it possible to have a uniform select loop
for both cursors and connections, in which you always start by polling
the object and then acting according to the result from poll().
Idea and implementation by Daniele Varrazzo.
2010-04-14 09:56:44 +02:00
Jan Urbański
4afc1baf35
Make polling a cursor that's not in an async query raise an exception.
...
If there is an asynchronous query, polling a cursor that did not
initiate it will raise an exception. Polling while there is no
asynchronous query underway still works, because the user needs to
have a way to get asynchronous NOTIFYs.
2010-04-14 09:56:44 +02:00
Federico Di Gregorio
a90935930b
Merge remote branch 'piro/fix22' into python2
2010-04-14 08:57:30 +02:00
Federico Di Gregorio
eaa97def73
Applied GC patch from Michael Tharp
2010-04-14 08:50:16 +02:00
Daniele Varrazzo
431920b367
Added recipe to get Python floats from Postgres decimals in the FAQ.
2010-04-14 01:05:36 +01:00
Daniele Varrazzo
0ac4c8ac17
Typecasters section in the extensions doc reordered.
2010-04-14 00:41:03 +01:00
Daniele Varrazzo
d162c08cfa
PY* and MX* typecasters imported into the extensions module.
2010-04-14 00:27:28 +01:00
Daniele Varrazzo
54e9c89ea4
DECIMAL typecaster imported into the extensions module.
2010-04-14 00:20:16 +01:00
Daniele Varrazzo
595dc7effa
Added a test to check poll() correctly calls PQflush.
...
When a large query is sent to the backend (and probably in high
concurrency situations), writing the query could block. In
this case PQflush() should be called until it returns 0. The test checks
this is done correctly.
2010-04-11 01:05:31 +01:00
Daniele Varrazzo
88fe5f91d2
Fixed parameters parsing in the connection constructor.
...
Keyword arguments were silently discarded.
2010-04-11 00:30:54 +01:00
Daniele Varrazzo
47ff5a6b01
test_async made properly executable.
2010-04-11 00:06:54 +01:00
Federico Di Gregorio
b8953cb345
Fixed Python 2.4 compatibility breakage
2010-04-09 12:53:38 +02:00
Federico Di Gregorio
0a33ed01f5
Added test for refcounting/gc bug reported by Michael Tharp
2010-04-08 18:42:20 +02:00
Daniele Varrazzo
6aaa50703e
Added documentation for the new asynchronous support.
2010-04-08 13:25:17 +01:00
Daniele Varrazzo
d197346ce3
Added test to check that connections subclasses can be asynchronous.
2010-04-08 12:51:33 +01:00
Daniele Varrazzo
236b97045e
Dropped README.async files referring to pre-2.2.
2010-04-08 10:51:30 +01:00
Daniele Varrazzo
e8286084e9
Free the GIL in blocking operations in V2 COPY FROM.
2010-04-07 23:52:53 +01:00
Daniele Varrazzo
aeec583ff1
Ensure running COPY in blocking mode.
2010-04-07 23:41:32 +01:00
Daniele Varrazzo
b114e25c31
Added some COPY tests.
2010-04-07 23:41:32 +01:00
Daniele Varrazzo
7e0dcfdda5
Added pq_set_non_blocking utility function.
2010-04-07 23:41:18 +01:00
Daniele Varrazzo
d339466c6a
Speedup of the copy functions.
...
Python objects are evaluated only once outside the I/O loops.
2010-04-07 18:22:31 +01:00
Daniele Varrazzo
5a75d693a3
Dropped warnings when compiling on Python 2.5
2010-04-07 18:12:24 +01:00
Daniele Varrazzo
c75ddea895
Pass the async parameter to the connection only if nonzero.
...
This avoids breaking connection subclasses redefining '__init__' (at
least when used sync, which is good for most of the people).
2010-04-05 18:31:09 +01:00
Daniele Varrazzo
c486136df7
Delegate the destruction of the PGconn to the connection finalization.
...
This way we can have an usable connection before complete
initialization: this will be required to allow a Python callback to
interact with connect().
2010-04-05 18:19:37 +01:00
Federico Di Gregorio
012e2e3c72
Preparing 2.2.0 release candidate 1
2010-04-05 17:06:35 +02:00
Federico Di Gregorio
c1a24f4ca2
NOTIFYs fix and poll status changes
...
POLL_OK has been changed from 3 to 0 to let the user specify a short loop
just as "if not curs.poll()" instead of having to check for write and read
separately. For an example of this, see examples/notify.py.
2010-04-05 16:52:25 +02:00
Jan Urbański
e15bc9da05
Adapt the tests to recent changes
...
Some methods were forbidden in asynchronous mode, the isolation level
of an asynchronous connection is not always 0 and these changes
influenced expected test results.
2010-04-05 16:28:39 +02:00
Jan Urbański
31f60be000
Be a bit more explicit
2010-04-05 16:27:59 +02:00
Jan Urbański
58eb868db6
Avoid the possibility when curs_get_last_result would block
...
It was trying to get all pending results from the connection and if
the client sent many and anyone except the first one would not be
immediately available the loop in curs_get_last_result would call
PQgetResult blockingly.
Avoid that by calling PQisBusy every time and telling the client to
wait for more data if it returns 1.
2010-04-05 16:27:39 +02:00
Jan Urbański
25a609c9a7
Handle initial connection queries being sent partly
...
The CONN_STATUS_SENT_* statuses were not being handled at all, and
they indicate that a query has been sent, but not fully, so the client
should wait for the socket to become writable again and flush the output.
2010-04-05 16:25:17 +02:00
Jan Urbański
b99eac18f8
Make cursor.scroll() raise an exception in asynchronous mode
...
The exception is raised if an asynchronous query is in progress,
otherwise it will behave normally (since the data is already on the
client side).
2010-04-05 16:24:45 +02:00
Jan Urbański
727670c269
Make some methods raise an exception in asynchronous mode
...
The methods changed are connection.commit(), rollback(), reset(),
set_isolation_level(), set_client_encoding(), lobject(), cursor(str)
as well as cursor.execute() and cursor.callproc() if another query is
in progress and cursor.executemany(), cursor.copy_{from,to,expert)().
2010-04-05 16:23:44 +02:00
Jan Urbański
01799e9137
Make asynchronous connections produce asynchronous cursors by default
...
Drop the async kwarg from cursor.execute(), cursors created by
asynchronous connections will be asynchronous by default, ones created
by synchronous connections will be synchronous.
Mind that this might break third party subclasses of
psycopg2.extensions.cursor, if they try to chain to the superclass in
their execute() implementation and are passing the async kwarg. The
example cursors in psycopg2.extras have been fixed no to do that.
2010-04-05 11:41:32 +02:00
Jan Urbański
d8ab5ac8a1
Make asynchronous connections always use autocommit
...
Clients using async connections are expected to do their own
transaction management by sending (asynchronously) BEGIN and COMMIT
statements.
As a bonus, it allows to drop one step from the async connection
building, namely getting the default isolation level from the server.
2010-04-05 11:37:06 +02:00
Jan Urbański
062a9602ae
Ref the async cursor before storing it in the connection
2010-04-05 11:36:09 +02:00
Jan Urbański
eb646f71fa
Add tests for the asynchronous API
2010-04-05 11:32:03 +02:00
Jan Urbański
91ef0e09ed
Change the API for asynchronous queries to use cursor.poll()
...
The isread() API was not safe, because the query might have not been
sent fully to the server after calling execute(). To make the async
API complete, a similar mechanism to async connections must be used.
The cursor now has a poll() method that you would use identically to
the poll() method of the connection class.
2010-04-05 11:31:50 +02:00
Jan Urbański
9b259a8a54
Disallow some methods depending on the connection's sync/async mode
2010-04-05 11:31:37 +02:00
Federico Di Gregorio
34317dc4c3
Support asynchronous connection building
...
After calling psycopg2.connect(dsn, async=True) you can poll the
connection that will tell you whether its file descriptor should be
waited on to become writable or readable or that the connection
attempt has succeeded.
Edited commit by Jan to not expose internal state in extensions.py.
2010-04-05 11:30:03 +02:00
Jan Urbański
1f6ffbba0f
Block and clear the result of asynchronous queries where necessary
...
Remove the big loop in pq_fetch with the select() call, among
others. Code paths that don't support asynchronous queries should now
be adequately guarded.
2010-04-05 11:28:20 +02:00
Federico Di Gregorio
3d2c315049
Checks for pointers should be explicit, i.e., (ptr != NULL)
2010-04-05 11:27:34 +02:00
Jan Urbański
cc37fd1ea9
Add curs_get_last_result, a function to get the last result from a connection
2010-04-05 11:24:57 +02:00
Jan Urbański
75a0299a48
Add pq_flush, a function to flush the output buffer
2010-04-05 11:07:53 +02:00
Federico Di Gregorio
3f2c1f6489
/me does not like empty for loops
2010-04-05 11:07:19 +02:00
Jan Urbański
53748443d8
Make pq_clear_async clear the whole pending result and export it
2010-04-05 11:01:44 +02:00
Jan Urbański
e0d789466a
Support large objects truncating.
...
The lobject.truncate(len=0) method will be available if psycopg2 has
been built against libpq from 8.3 or later (which is when the lobject
truncating support has been introduced).
2010-03-29 09:19:35 +02:00
Federico Di Gregorio
0edd520593
Preparing release 2.0.14 (final)
2010-03-13 21:15:50 +01:00
Federico Di Gregorio
b5373bd90a
Merge remote branch 'piro/python2' into python2
2010-03-12 17:37:04 +01:00
Federico Di Gregorio
21a6a64fd1
Changed setup.py to detect PostgreSQL "alpha" versions
2010-03-11 22:42:00 +01:00
Daniele Varrazzo
99620c1454
A bunch of typo fixed in the docs
2010-03-03 18:43:24 +01:00
Federico Di Gregorio
855674faf1
Fixed Python 2.4 segfault related to decimal implementation
2010-02-28 20:52:03 +01:00
Daniele Varrazzo
17a4cc9f67
All the docs todo points dropped: todo list removed.
2010-02-26 01:10:15 +00:00
Daniele Varrazzo
140e6ad4f2
Added notes about stuff changed in ver. 2.0.14.
2010-02-26 01:09:08 +00:00
Daniele Varrazzo
97ced0d4f1
Use the default role for cross referencing Python objects.
2010-02-26 00:49:19 +00:00
Daniele Varrazzo
4412826556
Added documentation for the 'pool' module.
2010-02-26 00:46:23 +00:00
Federico Di Gregorio
3636bc4201
Release candidate 1
2010-02-22 19:45:48 +01:00
Federico Di Gregorio
b99f2d5f8e
Added a couple more questions to the FAQ
2010-02-22 19:38:47 +01:00
Federico Di Gregorio
6733c64412
Varrazzo has two "r"!
2010-02-22 09:09:44 +01:00
Federico Di Gregorio
1b3e16e6fe
MANIFEST.in does not prune docs/html/_sources anymore
2010-02-22 09:06:28 +01:00
Federico Di Gregorio
b46035c222
Merge remote branch 'remotes/piro/python2' into python2
2010-02-22 09:05:40 +01:00
Federico Di Gregorio
fd6d3185b4
Preparing release 2.0.14
2010-02-21 01:26:43 +01:00
Federico Di Gregorio
4712ad1550
Added documentation to project
2010-02-21 01:09:40 +01:00
Federico Di Gregorio
192034dc38
Fixed problem with decimal.Decimal conversions
2010-02-21 01:04:00 +01:00
Daniele Varrazzo
50f5daef8b
Added FAQ section to the documentation.
2010-02-18 04:12:49 +00:00
Daniele Varrazzo
29feed31b6
Cleaned up parameters style from the docs.
2010-02-18 04:12:46 +00:00
Daniele Varrazzo
a320f25a2a
Completed documentation for errorcodes module.
2010-02-16 00:38:44 +00:00
Daniele Varrazzo
96b7912bcf
Typo fixed in DictRow doc.
2010-02-16 00:38:15 +00:00
Daniele Varrazzo
8001795b95
More uniform titles style in docs index.
2010-02-16 00:37:47 +00:00
Daniele Varrazzo
491bbb111c
Fixed code block.
2010-02-16 00:37:17 +00:00
Daniele Varrazzo
289ab1cd8d
Binary adapter imported from the correct module.
2010-02-16 00:36:59 +00:00
Daniele Varrazzo
c72fbf0b0f
Fixed example (with doctest) for Inet
2010-02-16 00:36:48 +00:00
Daniele Varrazzo
9ba6102f66
Added documentation for database large objects.
2010-02-16 00:36:32 +00:00
Daniele Varrazzo
d08d9ab199
Added errorcodes.lookup() function.
2010-02-15 01:38:49 +00:00
Daniele Varrazzo
3da7a33ffb
Added script to update the errorcodes module.
2010-02-15 01:12:13 +00:00
Daniele Varrazzo
bcfdbd1903
Error codes updated to include all errors between PostgreSQL 8.1 and 8.4.
2010-02-15 01:07:28 +00:00
Daniele Varrazzo
be30f43181
Inet adapter fixed.
2010-02-14 20:14:17 +00:00
Daniele Varrazzo
cf3b7e7e50
Whitespace fixed
2010-02-14 19:45:22 +00:00
Daniele Varrazzo
c167a6f07f
Manifest contains both rendered and source documentation.
2010-02-14 16:45:36 +00:00
Daniele Varrazzo
b744c92f58
Documentation dir reordered.
2010-02-14 16:45:36 +00:00
Daniele Varrazzo
620f77cb77
Generate text documentation in a single file.
2010-02-14 16:45:31 +00:00
Daniele Varrazzo
a1fa06e6d8
Drop table moved off the example.
2010-02-14 13:23:05 +00:00
Daniele Varrazzo
f134bceb00
Added function to drop a test table in the doctest.
2010-02-14 13:23:05 +00:00
Daniele Varrazzo
a54336f7b4
Docs cleaned up while still being testable.
2010-02-14 13:23:05 +00:00
Daniele Varrazzo
47809c338f
Added 'make check' target to docs.
2010-02-14 13:23:05 +00:00
Daniele Varrazzo
edc690e60a
Index and targets for subclassing work again.
2010-02-14 13:23:04 +00:00
Jonathan Ballet
323340abc6
The documentation is now mostly doctest-able
2010-02-14 13:23:04 +00:00
Federico Di Gregorio
67de65040c
Fixed license in trove categories
2010-02-14 13:35:49 +01:00
Daniele Varrazzo
12bd7bf7cc
Documentation generated in 'doc/html/' instead of 'doc/_build/html/'
2010-02-14 01:10:37 +00:00
Federico Di Gregorio
1a3e231e51
License change for psycopg2da
...
LGPL3+ZPL is fine for me, thanks.
Fabio
2010-02-14 01:23:57 +01:00
Federico Di Gregorio
4b58fc640e
License change for lib/errorcodes.py
...
You hereby have my blessing to go ahead and license all my contributions to
the psycopg2 project, including lib/errorcodes.py to LGPL3(+).
-- Johan Dahlin
2010-02-14 01:19:17 +01:00
Daniele Varrazzo
00805633b2
Added README to explain how to build the documentation.
2010-02-14 00:39:49 +01:00
Daniele Varrazzo
a313011a57
Added a bunch of versions update informations.
2010-02-14 00:39:49 +01:00
Daniele Varrazzo
e4d427aae6
Added documentation for 'Error.pgerror' and 'Error.pgcode' attributes.
2010-02-14 00:39:49 +01:00
Daniele Varrazzo
c72dc3af00
Added documentation for 'connection.reset()' method.
2010-02-14 00:39:49 +01:00
Daniele Varrazzo
a856f0724e
Use the module version as documentation version.
2010-02-14 00:39:49 +01:00
Daniele Varrazzo
ba1354502e
Added documentation for the errorcodes module.
2010-02-14 00:39:49 +01:00
Daniele Varrazzo
8246b28563
Removed files used by the Epydoc documentation.
2010-02-14 00:39:49 +01:00
Daniele Varrazzo
e11199c420
Dropped fixed point.
2010-02-14 00:39:49 +01:00
Daniele Varrazzo
b90f2925d0
Removed modules index from the doc front page.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
3789f8fb17
Added other info about tz module.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
6a4ff65b49
Added documentation for the extras module.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
ec68569e58
Dropped implementation details from the cursor documentation.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
e7d1d7ae1e
Just discovered how to put many objects in the same directive.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
53f3248976
Added example about how to deal with the cursor bad exception.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
885dbf6428
Cleanup in the usage file.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
0694b85e59
Added documentation about Unicode handling.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
9a6c4c4c93
Fixed repetition in exceptions docs.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
c8010cfd47
Big documentation cleanup.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
6ea6d48f5d
Added docutils SQL role.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
5491dd8db0
Added documentation to type casting objects.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
74403ff5a8
Fixed newline in docstring.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
c176a9d075
Fixed jumbled COPY methods.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
6199ce5127
Fixed typo in example.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
5431890938
Added introductive section about sessions.
2010-02-14 00:39:48 +01:00
Daniele Varrazzo
10f1a5b57a
Added CSS style for TODO admonitions.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
5cb07685ca
Showing the points where Psycopg diverges from the DB API.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
5417d7153d
Added `extension
` directive to mark Psycopg extensions to the DB API.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
3e66529864
Uniform usage of DB API spelling.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
9955b2f32f
Using uppercase P when dealing with Psycopg - not the module.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
5c732ac2a3
Asynchronous queries marked as experimental.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
4708704f16
Added documentation about asynchronous notifications.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
ac6640fd9e
Completed documentation for the COPY-related methods.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
d081d533b9
A few index entries fixed.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
e0065bfbef
Added a bunch of index entries for the connection class.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
a9b793a371
Added documentation for `connection.notices
`
2010-02-14 00:39:47 +01:00
Jonathan Ballet
1a7a12c833
Fixed some typos
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
961b4eedc5
First iteration with the Sphinx module documentation.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
442d8693cd
Ignore vim temporary files.
2010-02-14 00:39:47 +01:00
Daniele Varrazzo
04db8e7428
Fixed docstring for 'QueryCanceledError' exception.
2010-02-14 00:35:48 +01:00
Daniele Varrazzo
f6e87fbb30
Moved status from beta to stable in trove classifier.
2010-02-14 00:35:48 +01:00
Daniele Varrazzo
08e14e1049
Restored meaning of the word "respectively".
2010-02-14 00:35:48 +01:00
Daniele Varrazzo
e1b3c7b940
Fixed Inet constructor.
2010-02-14 00:35:48 +01:00
Daniele Varrazzo
0dbe068df4
Stop the loop variable used to create __all__ leaking in the module.
2010-02-14 00:35:47 +01:00
Federico Di Gregorio
0089201ba2
Binary was not imported from _psycopg; now it is
2010-02-13 00:52:36 +01:00
Federico Di Gregorio
a9673f31d6
SQL_IN adapter is now automatically registered
2010-02-13 00:40:29 +01:00
Federico Di Gregorio
3b4c0443e4
Removed debug logging calls
2010-02-13 00:15:39 +01:00
Federico Di Gregorio
611606d532
Changes license to LGPL3 + OpenSSL exception on all source files
2010-02-12 23:34:53 +01:00
Federico Di Gregorio
e5bed4993b
Fixed register_tstz_w_secs() error
2010-02-10 18:16:00 +01:00
Federico Di Gregorio
bcc836c661
Now adapt() errors include the type name
2009-11-25 11:51:54 +01:00
Federico Di Gregorio
d40a5321f2
Fixed test broken by float precision fix
2009-11-25 10:38:31 +01:00
Federico Di Gregorio
7b730f3935
Fixed float loss of precision
2009-11-09 09:17:05 +01:00
Jason Erickson
b537404487
Fixed --have_ssl command line parameter
...
Added initialization of have_ssl variable so passing --have_ssl on the
command line works.
2009-10-08 13:18:55 +02:00
Jason Erickson
ac1b5ce68a
Unclear error message when no pg_config found
...
If unable to find pg_config, a warning will be printed instead of stopping
the build process and displaying a generic error message.
2009-10-08 13:17:26 +02:00
Jason Erickson
5a3e07a610
Rearranged code to fix recent MSVC errors
...
Rearranged code to fix recent MSVC errors, such as mutex locking in conn_setup
to after the delcarations of variables.
2009-10-04 23:38:16 +02:00
Jason Erickson
69a8400e60
Added additional library required for PostgreSQL 8.4.x
...
For MSVC, added an additional library to include that is required for
PostgreSQL 8.4.x.
2009-10-04 23:37:14 +02:00
Jason Erickson
0f00ee129d
Moved declarations of varaibles/pointers to the beginning of functions
...
Moved the declarations of varaibles/pointers to the beginning of the functions,
where MSVC requires them to be defined.
2009-10-04 23:35:29 +02:00
Federico Di Gregorio
69224032ce
Fixed missing entry in NEWS file
2009-10-04 12:55:28 +02:00
Federico Di Gregorio
9bd771cda0
Preparing release 2.0.13
2009-10-04 12:53:42 +02:00
Federico Di Gregorio
8bb617ee76
Added very large lobject creation to the lobject.py example
2009-10-04 12:50:16 +02:00
Federico Di Gregorio
9670c9eddc
Enabled linking to static libpq
2009-10-04 12:43:30 +02:00
Federico Di Gregorio
390a9c2451
Added support for UUID arrays
2009-10-04 12:34:02 +02:00
Federico Di Gregorio
7022269b3d
Fixed a deadlock when using the same connection from multiple threads
2009-10-04 12:02:02 +02:00
Federico Di Gregorio
1c9fa1355d
Added README file about async support.
2009-10-04 11:33:35 +02:00
Federico Di Gregorio
0fc94be496
Preparing release 2.0.12
2009-08-09 17:22:18 +02:00
Federico Di Gregorio
3a6911216b
Fixed problem with large writes in large objects code
2009-08-09 17:05:16 +02:00
Federico Di Gregorio
a2af059e6c
Fixed PostgreSQL version detection
2009-08-09 16:28:27 +02:00
Federico Di Gregorio
29d00f56f6
Fix for retry on serialization errors for ZPsycopgDA
2009-08-09 16:22:43 +02:00
Federico Di Gregorio
36aff2f73d
Implemented connection.reset()
2009-08-09 16:19:08 +02:00
Federico Di Gregorio
4c3e2ad94b
Fixed problem with lots of columns in COPY operations
2009-08-09 15:13:42 +02:00
Federico Di Gregorio
e5a696ad58
Fixed version check in ZPsycopgDA
2009-08-09 14:53:41 +02:00
Federico Di Gregorio
091102a919
Preparing release 2.0.11
2009-05-09 14:52:16 +02:00
Federico Di Gregorio
e1fae0fcac
Fixed bug in RealDictCursor when prefetching
2009-05-09 14:44:59 +02:00
Federico Di Gregorio
3935c019fe
Fixed error in fetchXXX methods
2009-05-09 14:28:40 +02:00
Federico Di Gregorio
06eb574cec
Applied DictRow "diet" patch
2009-05-09 10:19:15 +02:00
Federico Di Gregorio
aecdf33b17
Removed old project files
2009-04-26 14:39:19 +02:00
Federico Di Gregorio
b0741721c3
Migrated project to MS Visual Studio 2008 format and repo to Git
2009-04-26 14:38:41 +02:00
Federico Di Gregorio
5e3fa15091
Better detection of PostgreSQL version
2009-04-21 00:38:09 +02:00
Federico Di Gregorio
f68d828f6b
Release 2.0.10
2009-04-20 20:37:59 +02:00
Federico Di Gregorio
d621c02e58
Preparing release 2.0.10
2009-04-20 20:34:06 +02:00
Federico Di Gregorio
85fdc828e7
Fix to double free segfault in cursor
2009-04-20 20:19:55 +02:00
Federico Di Gregorio
5db66038fe
Fix to double free segfault in connection
2009-04-19 16:51:31 +02:00
Federico Di Gregorio
5dab867db4
Added get_parameter_status() implementation
2009-04-19 16:42:06 +02:00
Federico Di Gregorio
39d6d8ad11
Exposed protocol_version and server_version
2009-04-19 16:36:10 +02:00
Federico Di Gregorio
e3a5ae8e20
Added a couple of test scripts to sandbox
2009-04-19 16:25:49 +02:00
Federico Di Gregorio
bb77a6912f
Added missing dict methods in DictRow
2009-04-19 16:25:12 +02:00
Federico Di Gregorio
bd19e3148c
Removed calls to PyMem_XXX when not holding the GIL
2009-04-07 09:25:05 +02:00
Federico Di Gregorio
16c2a8fc81
Cleaned conn_notice_callback() to run without the GIL
2009-04-04 19:17:40 +02:00
Federico Di Gregorio
f1e532151f
Removed unecessary import
2009-04-04 19:14:53 +02:00
Federico Di Gregorio
8e54f7dcce
Fixed test_dates failures in older version of Python
2009-04-01 20:52:58 +02:00
Federico Di Gregorio
e8ef973ddf
Fixed lobject test failures
2009-04-01 20:49:00 +02:00
Federico Di Gregorio
850423d8fc
Fixed setup script to handle PostgreSQL devel version strings
2009-03-21 12:54:44 +01:00
Federico Di Gregorio
825a60eec5
Removed spurious print
2009-03-16 22:15:20 +01:00
Federico Di Gregorio
0b0639dae5
Fixed error when adapt()ing None
2009-03-09 21:45:49 +01:00
Federico Di Gregorio
a574321fcd
NEWS for 2.0.10
2009-03-02 11:07:36 +01:00
Federico Di Gregorio
1daf300ca3
Support for seconds in time zone offsets
2009-03-02 11:07:17 +01:00
Federico Di Gregorio
5b04203c9f
Fixed error in register_type()
2009-03-02 10:59:52 +01:00
Federico Di Gregorio
a3ce636be0
Fixed error in register_type()
2009-03-02 10:56:53 +01:00
Federico Di Gregorio
4077711050
More cross-platform build fixes
2009-03-02 09:19:23 +01:00
Federico Di Gregorio
5c0cfa86bf
isinf() for Solaris
2009-02-27 11:02:45 +01:00
Federico Di Gregorio
71c7825b9c
Release 2.0.9
2009-02-23 21:39:47 +01:00
Federico Di Gregorio
9b259bba86
Removed some spurious tabs
2009-02-23 21:39:25 +01:00
Federico Di Gregorio
49bdaf92f6
Merge from trunk
2009-02-22 23:39:13 +01:00
Federico Di Gregorio
a6dff6c82a
Preparing release 2.0.9
2009-02-22 23:37:34 +01:00
James Henstridge
9067bde803
* psycopg/utils.c (psycopg_escape_string): same here.
...
* psycopg/adapter_binary.c (binary_escape): simplify PostgreSQL
version check.
* setup.py (psycopg_build_ext.finalize_options): use a single
define of the PostgreSQL version in a form that can easily be used
by #ifdefs.
2009-02-17 16:00:52 +09:00
James Henstridge
2a94dfae47
* tests/test_dates.py (DatetimeTests, mxDateTimeTests): full test
...
coverage for datetime and time strings with and without time zone
information.
* psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): adjust
to handle the changes in typecast_parse_time.
(typecast_PYTIME_cast): add support for time zone aware time
values.
* psycopg/typecast_mxdatetime.c (typecast_MXDATE_cast): make sure
that values with time zones are correctly processed (even though
that means ignoring the time zone value).
(typecast_MXTIME_cast): same here.
* psycopg/typecast.c (typecast_parse_time): Update method to parse
second resolution timezone offsets.
2009-02-17 15:03:33 +09:00
James Henstridge
ba8be438bb
* psycopg/typecast.c (typecast_parse_time): Fix up handling of
...
negative timezone offsets with a non-zero minutes field.
* tests/test_dates.py (DatetimeTests): Add tests for time zone
parsing. The test for HH:MM:SS time zones is disabled because we
don't currently support it.
2009-02-17 12:58:45 +09:00
James Henstridge
3466b3b72d
Add tests for time zone parsing, for "HH", "HH:MM" and "HH:MM:SS" forms.
...
Currently the second fails for negative offsets due to bugs in the
parser, and the third fails because it doesn't even try to parse second
offset values (as Python doesn't either).
2009-02-17 12:39:57 +09:00
Federico Di Gregorio
41dd7a1095
Compile again on modern FreeBSD
2009-02-16 10:00:34 +01:00
Federico Di Gregorio
f9fa711f03
Modified executemany() to return modified rows count
2009-02-07 18:02:14 +01:00
Federico Di Gregorio
eb25f9f154
Added adapter to handle float('inf') and float('nan')
2009-01-23 00:09:20 +01:00
Federico Di Gregorio
e22451736a
register_type() now works on connection and cursor subclasses
2009-01-22 11:02:38 +01:00
Federico Di Gregorio
78c0765367
Merge from public trunk
2009-01-10 18:51:45 +01:00
Federico Di Gregorio
f5ec676566
Added isready() error test to sandbox
2009-01-10 18:48:31 +01:00
Federico Di Gregorio
aeb5080208
Fixed isready() not throwing exception on error
2009-01-10 18:48:08 +01:00
James Henstridge
83b03e5e36
If we are depending on Python 2.4, we don't need to make decimal module
...
support conditional.
2008-12-27 00:03:11 +09:00
James Henstridge
345a254ca0
Remove conditionals on support for booleans and datetimes, since they
...
are guaranteed to be available in Python 2.4.
2008-12-26 23:46:35 +09:00
James Henstridge
e7b8d6505e
Remove backward compatibility support for Python versions older than
...
2.4, since we don't really support them any way.
2008-12-26 09:37:44 +09:00
Federico Di Gregorio
5480cf5332
Fixed memory leak in lobject
2008-12-04 16:58:05 +01:00
Federico Di Gregorio
4eb295a8ca
Patch from Jason Erickson to build on MSVC
2008-11-26 09:51:53 +01:00
Federico Di Gregorio
5c982d90f0
Unified string quoting
2008-11-25 19:18:17 +01:00
Federico Di Gregorio
4810789194
Removed non-existing files from project
2008-11-25 17:53:48 +01:00
Federico Di Gregorio
4e359f6f05
Applied COPY patch from Alejandro Dubrovsky (missing files and project)
2008-11-25 17:46:15 +01:00
Federico Di Gregorio
c1d6073531
Applied COPY patch from Alejandro Dubrovsky
2008-11-25 17:45:22 +01:00
Federico Di Gregorio
b9157c8ba1
Merged changed by JH from head
2008-09-24 01:29:20 +02:00
Federico Di Gregorio
4c8e80038e
Added inet support
2008-09-24 01:27:52 +02:00
James Henstridge
cc2aa0a9ca
* psycopg/psycopg.h (NotSupportedError_doc): clean up
...
spelling/grammar a bit, using exception description from the PEP.
2008-09-23 17:22:37 +08:00
Federico Di Gregorio
56f6001d6d
Support for NULLs in UUID
2008-09-23 09:11:11 +02:00
Federico Di Gregorio
b92601306e
Added suppport for UUID and related test.
2008-09-19 21:25:16 +02:00
Federico Di Gregorio
758eaf23d1
Preparing release 2.0.8
2008-09-16 09:58:44 +02:00
James Henstridge
bc662db1cc
Fill in a few more items in the NEWS file for 2.0.8.
2008-08-26 14:47:47 +08:00
Federico Di Gregorio
f6a25ccdf0
Build fix from Jorgen Austvik
2008-08-02 10:30:36 +02:00
Federico Di Gregorio
ceee4c816f
Merge from jh
2008-07-26 15:10:02 +02:00
Federico Di Gregorio
e95a4d9d2e
get_backend_pid() patch and fixes
2008-07-26 15:09:20 +02:00
James Henstridge
a2f3e4a3ac
* psycopg/lobject_type.c (lobject_setup): use
...
FORMAT_CODE_PY_SSIZE_T in Dprintf() call for 64-bit compatibility
when using Python 2.5 or later.
(lobject_dealloc): same here.
2008-07-23 16:57:10 +08:00
James Henstridge
0aec2840d8
Merge support for cyclic GC in relevant types that psycopg defines.
2008-07-23 16:50:24 +08:00
James Henstridge
2273b79be9
Use Py_CLEAR() in a few more places, and do INCREF's before setting
...
struct members rather than afterwards.
2008-07-21 13:41:54 +08:00
James Henstridge
e0287c0db4
* psycopg/adapter_qstring.c (qstring_traverse): add cyclic GC
...
traversal for quoted string adapters.
* psycopg/adapter_pboolean.c (pboolean_traverse): add cyclic GC
traversal for boolean adapters.
* psycopg/adapter_mxdatetime.c (mxdatetime_traverse): add cyclic
GC traversal for mxdatetime adapters.
* psycopg/adapter_datetime.c (pydatetime_traverse): add cyclic GC
traversal for datetime adapters.
2008-07-18 17:42:31 +08:00
James Henstridge
590542e973
* psycopg/adapter_binary.c (binary_traverse): add cyclic GC
...
traversal for binary adapters.
2008-07-01 11:59:25 +08:00
James Henstridge
47d2414e32
* psycopg/adapter_asis.c (asis_traverse): add cyclic GC traversal
...
for AsIs adapters.
2008-07-01 09:57:16 +08:00
James Henstridge
fd538a8b17
* psycopg/adapter_list.c (list_traverse): add cyclic GC traversal
...
for list adapters.
2008-07-01 09:34:51 +08:00
Federico Di Gregorio
a5e01ef0df
Fixed spaces in pg_config path
2008-06-28 18:34:57 +02:00
Federico Di Gregorio
e664abb248
Added XXXARRAY imports to psycopg2.extenions
2008-05-30 00:39:50 +02:00
James Henstridge
26693621ef
* psycopg/cursor_type.c (cursor_setup): incref before setting
...
attributes, to make things GC-safe.
* psycopg/cursor_int.c (curs_reset): make clearing of description
and casts attributes GC-safe.
2008-05-28 17:45:37 +08:00
James Henstridge
bbd101bb7e
* psycopg/typecast.c (typecast_traverse): implement cyclic GC
...
traversal for typecasters.
2008-05-28 17:22:40 +08:00
James Henstridge
a39fb19eb9
* psycopg/connection_type.c:
...
* psycopg/cursor_type.c: add support for cyclic GC.
* psycopg/python.h: add definitions for Py_CLEAR() and Py_VISIT()
for compatibility with old versions of Python.
2008-05-28 09:00:36 +08:00
Federico Di Gregorio
5a428642f8
COPY problem tests and partial fix
2008-05-27 17:40:19 +02:00
Federico Di Gregorio
6073193314
Fixed memory leak in executemany
2008-05-19 10:14:17 +02:00
Fabio Tranchitella
f1fab54b97
Update debian packaging files.
2008-05-12 15:33:10 +08:00
James Henstridge
ee235478bd
* psycopg/lobject.h (lobjectObject): remove "mode" struct member,
...
since it was unused.
2008-05-06 18:12:50 +08:00
James Henstridge
9d20f5c09c
* psycopg/lobject_*.c: replace uses of the closed struct member,
...
and change the Python level attribute to a getset.
* psycopg/lobject.h (lobjectObject): remove the closed member,
since "fd < 0" gives us the same information. Reorder the struct
members for better packing.
2008-05-06 18:07:54 +08:00
James Henstridge
2046ae34fb
* psycopg/lobject*: const'ify the code.
2008-05-06 17:09:43 +08:00
James Henstridge
7d66c20edb
* tests/test_lobject.py (LargeObjectTests): add more tests,
...
including behaviour on closed lobjects and stale lobjects.
* psycopg/lobject_type.c (psyco_lobj_close): don't mark the
connection closed here because it is done by
lobject_close_locked().
* psycopg/lobject_int.c (lobject_open): mark objects as not closed
if we successfully open them.
(lobject_close_locked): mark the lobject closed here.
(lobject_export): ensure we are in a transaction, since
lo_export() issues multiple queries.
* psycopg/lobject_type.c (lobject_setup): make lobjects start closed.
2008-05-06 17:04:26 +08:00
James Henstridge
e627948a6b
* psycopg/lobject.h: don't export the lobjectType symbol.
2008-05-05 22:51:15 +08:00
Federico Di Gregorio
0319bc8cc4
Fixed build error on SUN
2008-05-05 15:55:51 +02:00
James Henstridge
975d2286e8
Merge lobject work from trunk, plus fixes to make it work with current
...
psycopg2.
2008-05-05 19:23:33 +08:00
James Henstridge
9a48c261be
Add basic tests for large object code. Fix lobject.seek() to actually
...
work.
2008-05-05 15:33:44 +08:00
James Henstridge
e192c603fa
Fix up structmember definitions to match real types. T_LONG is not the
...
same as T_INT/T_UINT on AMD64 ...
2008-05-05 15:00:50 +08:00
James Henstridge
82557e65a2
Fix up pq_complete_error() calls.
2008-05-05 15:00:34 +08:00
James Henstridge
5beef38bfc
Fix double free in case where PGresult is NULL.
2008-05-05 14:16:57 +08:00
James Henstridge
ec20fa8912
Some changes to the lobject code to match changes in pqpath.[ch].
2008-05-05 12:07:24 +08:00
James Henstridge
3cfe438b74
Add an #endif I accidentally removed
2008-05-05 10:43:38 +08:00
James Henstridge
e01da0a540
add ignores
2008-05-05 10:39:13 +08:00
James Henstridge
938c456cee
Merge changes from psycopg2/trunk via psycopg2.r243.
2008-05-05 10:37:24 +08:00
James Henstridge
31ef9355c2
Merge psycopg2/trunk into psycopg2/branches/2_0_x r243 (which is the
...
last revision merged into trunk). Where file ID conflicts exist, but
the content was equivalent, I've picked the 2_0_x version.
2008-05-05 10:22:22 +08:00
Fabio Tranchitella
fedfd53d54
Added encoding.
2008-04-09 09:49:55 +00:00
Fabio Tranchitella
5930078ec7
Add the encoding property into the ZMI add form (debian bug #475123 ).
2008-04-09 09:47:45 +00:00
Federico Di Gregorio
3b1c2b24de
Signed all commits
2008-04-25 23:09:04 +02:00
James Henstridge
331c942800
2008-04-21 James Henstridge <james@jamesh.id.au>
...
* tests/test_quote.py (QuotingTestCase.test_unicode): If the
server encoding is not UTF8, skip the unicode test and emit a
warning.
2008-04-20 23:19:42 +00:00
James Henstridge
2f3f4c1258
2008-04-21 Jorgen Austvik <Jorgen.Austvik@sun.com>
...
* tests/*.py: use the DSN constructed in tests/__init__.py.
* tests/__init__.py: allow setting the host, port and user for the
DSN used by the tests through the environment.
2008-04-20 23:12:21 +00:00
Federico Di Gregorio
962c5a9a5f
Preparing release 2.0.7.
2008-04-14 05:23:15 +00:00
Federico Di Gregorio
f3438f2961
Preparing release 2.0.7.
2008-04-14 04:27:22 +00:00
Federico Di Gregorio
1fddaa8562
Added a couple of files used for tests.
2008-04-14 04:13:07 +00:00
James Henstridge
23866bc35d
* psycopg/connection_type.c (connection_dealloc): free
...
connection->encoding with free() instead of PyMem_Free().
* psycopg/connection_int.c (conn_connect): use malloc() to
allocate connection->encoding instead of PyMem_Malloc(), since it
is freed in other places with free() and assigned to with
strdup().
2008-03-30 22:15:21 +00:00
James Henstridge
e848585b90
* psycopg/typecast.c (typecast_from_c): fix up some reference
...
leaks. This leak affected a bounded set of objects, so doesn't
account for any gradual leaks.
2008-03-25 23:21:00 +00:00
James Henstridge
af1478feb9
* psycopg/connection_int.c (conn_notice_callback): don't leak
...
notice messages.
2008-03-19 01:01:26 +00:00
Federico Di Gregorio
8103f44a12
Fixed test segfault due to double decref.
2008-03-17 08:13:16 +00:00
James Henstridge
cceaa7331b
* psycopg/typecast.c (typecast_parse_time): give the correct
...
return value for partially parsed time values.
* psycopg/typecast_mxdatetime.c (typecast_MXDATE_cast): return
NULL after setting DataError. Also, don't treat it as an error if
typecast_parse_time() returns 0 (as might happen if the remainder
of the string is " BC").
* psycopg/typecast_datetime.c (typecast_PYDATE_cast): return NULL
after setting DataError.
(typecast_PYDATETIME_cast): same here.
(typecast_PYTIME_cast): same here.
* tests/test_dates.py
(CommonDatetimeTestsMixin.test_parse_incomplete_date): test that
parsing incomplete date values results in DataError.
(CommonDatetimeTestsMixin.test_parse_incomplete_time): same for
times.
(CommonDatetimeTestsMixin.test_parse_incomplete_time): same for
datetimes.
2008-03-17 04:06:44 +00:00
James Henstridge
1ea0cd4980
Missed the last bit of the commit message.
2008-03-06 19:35:47 +00:00
James Henstridge
475df5ebd6
2008-03-07 Jason Erickson <jerickso@stickpeople.com>
...
* psycopg/pqpath.c (pq_raise): if PSYCOPG_EXTENSIONS is not
defined, raise OperationalError rather than
TransactionRollbackError for deadlock or serialisation errors for
protocol versions less than 3.
2008-03-06 18:41:07 +00:00
James Henstridge
89cadcb553
2008-03-07 Jason Erickson <jerickso@stickpeople.com>
...
* psycopg/psycopgmodule.c (psyco_connect): fix off by one error in
calculating the length of the DSN.
2008-03-06 16:15:41 +00:00
James Henstridge
e55e2683cf
* psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs
...
without holding the GIL.
2008-03-06 15:12:40 +00:00
James Henstridge
14135c1d7e
* NEWS: add some draft NEWS items for a 2.0.7 release.
2008-02-27 04:42:56 +00:00
James Henstridge
fc2b684843
* runtests.py: add a harness to run all the psycopg tests against
...
the version built by distutils.
2008-02-27 02:29:55 +00:00
James Henstridge
b5f4a5f6c2
Fix off-by-one error in PyMem_Malloc() call in
...
psyco_conn_set_client_encoding(). Fixes #211
2008-02-13 16:01:10 +00:00
James Henstridge
6c2e3ab49b
* Add HIDDEN attribute to datetime related global variables.
...
* Make const strings static, which essentially makes them labels for the
strings.
2008-01-22 00:13:42 +00:00
James Henstridge
fe853d0261
* psycopg/typecast.c (typecast_pydatetime): make array static.
...
(typecast_mxdatetime): same here.
* psycopg/typecast_builtins.c (typecast_builtins): make array
static.
* psycopg/psycopgmodule.c: add hidden visibility to a bunch of
global variables here.
* psycopg/psycopg.h: add set QueryCanceledError and
TransactionRollbackError to hidden visibility.
2008-01-21 21:41:17 +00:00
James Henstridge
e054004e8f
Add more const qualifiers.
2008-01-21 21:01:08 +00:00
James Henstridge
eae563ac96
* psycopg/*.[ch]: add const qualifier to various string arguments
...
to functions (typecast functions and conn_switch_isolation_level).
2008-01-21 17:34:08 +00:00
James Henstridge
9fa039326c
* setup.cfg (define): remove PSYCOPG_DISPLAY_SIZE from default
...
list of defines, as discussed on mailing list. It slows down
queries with very little benefit.
2008-01-21 05:59:03 +00:00
James Henstridge
864d107325
* psycypg/*.h: apply HIDDEN to all global variables and functions
...
that should not be exported from the module. This results in a 5%
reduction in code size and shortens the dynamic symbol table.
* psycopg/config.h: If GCC >= 4.0 is installed, define the HIDDEN
symbol to apply the "hidden" visibility attribute.
2008-01-21 05:54:01 +00:00
James Henstridge
3265dd172d
* tests/test_connection.py (ConnectionTests): add simple tests for
...
the Connection and Cursor "closed" attributes.
* psycopg/cursor_type.c (psyco_curs_get_closed): add a "closed"
attribute to cursors. It will be True if either the cursor or its
associated connection are closed. This fixes bug #164 .
2008-01-19 03:32:42 +00:00
James Henstridge
11b017fcbe
* psycopg/pqpath.c (pq_raise): remove unused arguments to
...
function, and simplify.
(pq_resolve_critical): make function static, since it isn't being
used outside of pqpath.c any more.
2008-01-19 02:16:57 +00:00
James Henstridge
e744242fe1
Update the debian directory (debian release 2.0.6-3).
2008-01-17 23:59:42 +00:00
James Henstridge
abb0a6f52c
(App.ImageFile): simplify ImageFile import using patch from
...
chrism, fixing bug #198 .
2008-01-16 23:16:59 +00:00
James Henstridge
6d9b6a977c
* ZPsycopgDA/DA.py (Connection.__init__): Default the encoding to
...
UTF-8, fixing bug #190 .
2008-01-16 18:56:13 +00:00
James Henstridge
bc663111b6
Split the binary tests out a bit.
2008-01-16 18:08:12 +00:00
James Henstridge
f64cbeda46
* tests/test_transaction.py (DeadlockSerializationTestCase): port
...
over some tests for serialisation and deadlock errors,
demonstrating that TransactionRollbackError is generated.
(QueryCancelationTests): add a test to show that
QueryCanceledError is raised on statement timeouts.
* psycopg2da/adapter.py (_handle_psycopg_exception): rather than
checking exception messages, check for TransactionRollbackError.
* psycopg/pqpath.c (exception_from_sqlstate): return
TransactionRollbackError for 40xxx errors, and QueryCanceledError
for 57014 errors.
(pq_raise): If we are using an old server, use
TransactionRollbackError if the error message contains "could not
serialize" or "deadlock detected".
* psycopg/psycopgmodule.c (_psyco_connect_fill_exc): remove
function, since we no longer need to store pointers to the
exceptions in the connection. This also fixes a reference leak.
(psyco_connect): remove _psyco_connect_fill_exc() function call.
* psycopg/connection.h (connectionObject): remove exception
members from struct.
* psycopg/connection_type.c (connectionObject_getsets): modify the
exception attributes on the connection object from members to
getsets. This reduces the size of the struct.
* lib/extensions.py: import the two new extensions.
* psycopg/psycopgmodule.c (exctable): add new QueryCanceledError
and TransactionRollbackError exceptions.
2008-01-16 05:14:24 +00:00
James Henstridge
46bf23caf4
* tests/__init__.py (test_suite): add date tests to test suite.
...
* tests/test_dates.py: add tests for date/time typecasting and
adaption.
* psycopg/adapter_mxdatetime.c (mxdatetime_str): add support for
outputting BC dates (which involves switching them to one-based
dates). Also remove broken handling of microseconds.
* psycopg/typecast.c (typecast_parse_date): if the string ends
with "BC" adjust the year value to be a zero-based BC value as
used by mx.DateTime (datetime doesn't support BC dates).
(typecast_parse_time): ignore ' ', 'B' and 'C' in time strings
rather than treating them as part of the seconds part of the time.
2008-01-16 01:43:50 +00:00
James Henstridge
f18881983b
* psycopg/typecast_array.c (typecast_array_scan): set an initial
...
value for quotes to keep gcc happy.
* psycopg/*.c: add missing static modifier on many functions.
2008-01-13 16:05:59 +00:00
James Henstridge
7d80c05748
* tests/test_transaction.py
...
(TransactionTestCase.test_failed_commit): Expect IntegrityError
instead of OperationalError.
* psycopg/pqpath.c (exception_from_sqlstate): new function that
converts an SQLSTATE error code to the corresponding exception
class.
(pq_raise): use exception_from_sqlstate() to pick which exception
to use when working with protocol version 3.
(pq_complete_error): Let pq_raise() pick an appropriate exception
rather than forcing OperationalError.
2008-01-11 15:10:21 +00:00
James Henstridge
86597f6939
* psycopg/adapter_binary.c (binary_quote): apply Brandon Rhodes'
...
patch from ticket #209 to check return value from
PyObject_AsCharBuffer(). This fixes the segfault.
(binary_quote): switch from PyObject_AsCharBuffer() to
PyObject_AsReadBuffer() to support buffer objects that don't
implement the bf_getcharbuf protocol.
* tests/types_basic.py (TypesBasicTests.testBinary): Test round
tripping of bytea buffers. Currently segfaults.
2008-01-10 22:19:23 +00:00
James Henstridge
729117af8b
* psycopg/connection_int.c (conn_close): fix for new
...
pq_abort_locked() prototype.
(conn_switch_isolation_level): fix for new pq_abort_locked()
prototype, and use pq_complete_error() to show error message.
(conn_set_client_encoding): same here.
* psycopg/pqpath.c (pq_execute_command_locked): remove static
modifier.
(pq_complete_error): same here.
(pq_abort_locked): add pgres and error arguments.
(pq_abort): call pq_abort_locked() to reduce code duplication.
2008-01-10 18:14:44 +00:00
James Henstridge
d190d5918a
2007-12-23 James Henstridge <james@jamesh.id.au>
...
* psycopg/pqpath.c (pq_execute_command_locked): add an error
argument to hold an error when no PGresult is returned by PQexec,
rather than using pq_set_critical().
(pq_complete_error): new function that converts the error returned
by pq_execute_command_locked() to a Python exception.
(pq_begin_locked): add error argument.
(pq_commit): use pq_complete_error().
(pq_abort): use pq_complete_error().
(pq_abort_locked): always call pq_set_critical() on error, and
clear the error message from pq_execute_command_locked().
(pq_execute): use pq_complete_error() to handle the error from
pq_begin_locked().
* psycopg/pqpath.c (pq_begin): remove unused function.
* psycopg/connection_type.c (psyco_conn_commit): if conn_commit()
raises an error, just return NULL, since it is now setting an
exception itself.
(psyco_conn_rollback): same here.
* psycopg/connection_int.c (conn_commit): don't drop GIL and lock
connection before calling pq_commit().
(conn_rollback): same here.
(conn_close): use pq_abort_locked().
(conn_switch_isolation_level): same here.
(conn_set_client_encoding): same here.
* psycopg/pqpath.h: add prototype for pq_abort_locked().
* psycopg/pqpath.c (pq_commit): convert function to run with GIL
held, and handle errors appropriately.
(pq_abort): same here.
(pq_abort_locked): new function to abort a locked connection.
2007-12-22 James Henstridge <james@jamesh.id.au>
* psycopg/pqpath.c (pq_raise): add a "pgres" argument so we can
generate nice errors not related to a particular cursor.
(pq_execute): use pq_begin_locked() rather than pq_begin(). Use
pq_raise() to handle any errors from it.
* psycopg/pqpath.c (pq_execute_command_locked): helper function
used to execute a command-style query on a locked connection.
(pq_begin_locked): a variant of pq_begin() that uses
pq_execute_command_locked().
(pq_begin): rewrite to use pq_begin_locked().
2008-01-10 06:14:20 +00:00
James Henstridge
5fe08ae83e
2007-12-22 James Henstridge <james@jamesh.id.au>
...
* psycopg/config.h: only print debug messages if
psycopg_debug_enabled is true.
* psycopg/psycopgmodule.c (init_psycopg): set
psycopg_debug_enabled to true if the $PSYCOPG_DEBUG environment
variable is set.
2007-12-22 13:03:41 +00:00
Federico Di Gregorio
f3e74d2c48
DA version patch.
2007-12-21 00:45:01 +00:00
Federico Di Gregorio
d31b4add22
Applied win32 patch from Jason Erickson.
2007-12-21 00:18:55 +00:00
James Henstridge
4910f53b7e
* psycopg/pqpath.c (pq_execute): uncomment the "curs->pgres ==
...
NULL" error handler after the PQexec() call. This is needed to
catch database disconnects (and probably other errors). According
to Federico, it was commented out to avoid a spurious error, so we
should watch for problems.
2007-12-19 14:33:44 +00:00
James Henstridge
fd5d2d5238
* psycopg/pqpath.c (pq_raise): only remove the first 8 characters
...
of the exception message if it actually gives the severity.
* psycopg/pqpath.h (pq_resolve_critical): add prototype, since
this function is being used from connection_int.c.
* psycopg/psycopg.h: update psyco_set_error() prototype.
* psycopg/psycopgmodule.c (psyco_errors_init): set pgerror, pgcode
and cursor class attributes to None on psycopg2.Error so that the
attributes will always be available (simplifies error handling).
(psyco_set_error): add const qualifiers to msg, pgerror and pgcode
arguments.
Don't bother setting pgerror, pgcode or cursor to None if they are
not provided -- the class defaults take care of this.
2007-12-19 14:29:03 +00:00
Daniele Varrazzo
67afd678b0
Added 'make check' target, running all the available tests.
...
Most of the updates have been provided by James Henstridge.
Closes ticket #195 .
2007-11-11 10:40:12 +00:00
Daniele Varrazzo
fd1ee6fffc
Fixes to let the dbapi20 test suite pass.
...
Submitted by James Henstridge in ticket #195 .
2007-11-11 10:18:43 +00:00
Daniele Varrazzo
75cb5d75d7
Use escape string syntax for string escape if connected to a server
...
requiring it.
Added a connection flag to store whether E''-style quoting is required: this
avoids repeated PQparameterStatus() calls.
Added a test case to verify correct behavior on strings, unicode and binary
data. Tested with PG versions from 7.4 to 8.3b2, with any server
'standard_conforming_strings' setting and with 'PSYCOPG_OWN_QUOTING' too.
2007-11-11 08:53:44 +00:00
Daniele Varrazzo
a6ea092acc
- Tabs fixed.
2007-11-11 03:58:45 +00:00
Daniele Varrazzo
70e555585e
Fixed selection of the proper binary string quoting.
2007-11-09 13:00:37 +00:00
Daniele Varrazzo
272140f5c1
Use escape string syntax for binary escape if connected with a
...
server with ver >= 8.2.
The feature is only enabled when compiling psycopg with libpq
ver >= 8.0.
2007-11-09 05:51:12 +00:00
Daniele Varrazzo
7d408b47d7
ChangeLog updated after r903.
2007-11-09 05:49:13 +00:00
Daniele Varrazzo
277f57ffb0
- Hard limit on the connection.notices list to avoid them
...
growing indefinitely.
Notices are treated as a queue: when the queue is full
drop the oldest notice.
2007-11-09 02:28:47 +00:00
Daniele Varrazzo
e1dd9ca843
Fixed bug #192 (Decimal support not safe for use with multiple sub
...
interpreters) as proposed by Graham Dumpleton.
If running in the main interpreter, use a cached version of the Decimal
object. Else repeat the object lookup.
2007-10-21 03:22:55 +00:00
Daniele Varrazzo
63773ad1e0
Added missing DECREF.
2007-10-18 17:29:15 +00:00
Daniele Varrazzo
c71b7a03d0
Added missing return in case out of memory.
2007-10-18 17:19:16 +00:00
Federico Di Gregorio
1ed16c8265
Added test for DateTime object allocation bug.
2007-09-19 13:40:18 +00:00
Federico Di Gregorio
07892b29a6
Aggressive threading on fetch (and a new bug!)
2007-09-19 13:39:48 +00:00
Federico Di Gregorio
c9e701baa9
Fixed bug #194 (and added nice MD project not that C/C++ is supported.)
2007-09-08 08:54:30 +00:00
Federico Di Gregorio
0422506404
Added name parameters to .cursor() calls in extras.
2007-09-01 09:32:42 +00:00
Federico Di Gregorio
dfda372fae
Preparing release 2.0.6.
2007-06-08 00:39:06 +00:00
Federico Di Gregorio
98c0992b6e
Fix for #182 .
2007-05-29 08:56:25 +00:00
Federico Di Gregorio
dbbdcfb0c0
Fix for #182 .
2007-05-29 08:56:17 +00:00
Federico Di Gregorio
46668d214b
conn_commit/conn_rollback error handling ( closes : #187 ).
2007-05-29 08:43:34 +00:00
Federico Di Gregorio
a07987cd90
Patchset copy_expert 5/5.
2007-05-29 08:30:24 +00:00
Federico Di Gregorio
b82c2f5cd9
Patchset copy_expert 4/5.
2007-05-29 08:23:35 +00:00
Federico Di Gregorio
c54e9142f4
Patchset copy_expert 3/5.
2007-05-29 08:16:44 +00:00
Federico Di Gregorio
3b2908b51e
Patchset copy_expert 2/5.
2007-05-29 08:14:58 +00:00
Federico Di Gregorio
a23de80c6b
Patchset copy_expert 1/5.
2007-05-29 08:13:40 +00:00
Federico Di Gregorio
a779c8ef99
.get_transaction_status() implementation.
2007-04-25 22:42:36 +00:00
Federico Di Gregorio
d6e232e2b9
Various fixes, now all examples work.
2007-04-13 14:07:11 +00:00
Federico Di Gregorio
8274a032b1
typecast_binary.c cleanup.
2007-04-13 01:17:54 +00:00
Federico Di Gregorio
967ec370ed
int->size_t transition.
2007-04-13 01:16:22 +00:00
Federico Di Gregorio
ee44315ff2
Appliet Jasons patch to fix win32 build glitches.
2007-04-13 01:14:01 +00:00
Federico Di Gregorio
f57920b0dd
Release 2.0.6b2.
2007-04-11 07:12:16 +00:00
Federico Di Gregorio
2a6b523506
Fixed crash and win32 patches.
2007-04-11 04:16:00 +00:00
Federico Di Gregorio
d6f2aa27b7
Fixed mem and ref leak in connect().
2007-04-10 06:51:35 +00:00
Federico Di Gregorio
e5829292cd
Fixed both Python 2.5 and 64 bit problems.
2007-04-10 06:36:18 +00:00
Fabio Tranchitella
fadd1a6938
psycopg2da: better pattern matching for Retry exceptions; it is now compatible with postgresql 8.0, 8.1 and 8.2 exception messages.
2007-03-25 03:39:23 +00:00
Federico Di Gregorio
2ae0c32031
ZPsycopgDA now uses connection-level type-casters.
2007-02-23 15:23:06 +00:00
Federico Di Gregorio
6598a279e2
Added support for per-cursor and per-connection typecasters.
2007-02-22 15:16:54 +00:00
Federico Di Gregorio
c2e16b8901
Applied patch from #135 .
2007-02-11 08:25:33 +00:00
Federico Di Gregorio
09c866221c
Password obfuscation done right ( closes : #147 )
2007-02-11 08:11:22 +00:00
Federico Di Gregorio
3a94e747d7
Encodings from Karsten (part 2.)
2007-01-19 14:47:21 +00:00
Federico Di Gregorio
5642a68adb
Encodings from Karsten.
2007-01-19 14:38:01 +00:00
Federico Di Gregorio
1c16009985
Added support for NULL in arrays ( closes : #154 )
2007-01-19 14:08:06 +00:00
Federico Di Gregorio
2883428791
Lets do a beta release.
2007-01-19 03:40:27 +00:00
Federico Di Gregorio
b074dd4d8b
Encoding fixes.
2007-01-16 23:39:08 +00:00
Federico Di Gregorio
f43a52f781
Added RealDictCursor from #143 .
2007-01-16 13:45:41 +00:00
Federico Di Gregorio
5c425f5294
Check for Python errors during copy ( closes : #134 ).
2007-01-16 12:03:29 +00:00
Federico Di Gregorio
8c2c72a48a
Applied patch from #148 .
2007-01-16 11:32:01 +00:00
Federico Di Gregorio
e02f569dd3
Password obfuscation to close : #147 .
2007-01-16 11:29:07 +00:00
Federico Di Gregorio
bee60c203a
Fixed conversion of date to Zope DateTime ( closes : #145 )
2007-01-16 11:15:52 +00:00
Federico Di Gregorio
e59ef4de4b
Moved SQL_IN to extensions and away from extras.
2007-01-16 10:58:05 +00:00
Federico Di Gregorio
d342d37e27
Fixed problem with locales in mx.DateTime adaptation.
2007-01-16 10:47:28 +00:00
Federico Di Gregorio
b651781f63
Added note about missign pg headers to INSTALL.
2007-01-16 10:11:28 +00:00
Federico Di Gregorio
d061b384d9
Fixed problem with year > 9999.
2007-01-16 07:57:22 +00:00
Fabio Tranchitella
401af084ab
Renamed psycopgda-configure.zcml as psycopg2da-configure.zcml.
2006-11-06 00:37:45 +00:00
Federico Di Gregorio
f4dc6936a2
Builds again on win32 ( closes : #132 ).
2006-10-29 03:12:51 +00:00
Federico Di Gregorio
0f5e4e7340
Fixed #136 .
2006-10-21 07:39:16 +00:00
Federico Di Gregorio
ac5a747e95
Fixed precision and scale.
2006-10-21 07:33:44 +00:00
Federico Di Gregorio
bfe5b8fe6b
Added iteritem method to DictRow.
2006-10-06 05:22:54 +00:00
Federico Di Gregorio
d189203f9f
.callproc() patch from Moshe (support for result sets.)
2006-10-03 05:54:22 +00:00
Fabio Tranchitella
3381b0362b
Debian release 2.0.5.1-2.
2006-10-03 00:23:57 +00:00
Federico Di Gregorio
96f631d41e
Merge from 2.0 branch up to r839.
2006-09-30 06:57:35 +00:00
Federico Di Gregorio
5689f07de4
Infinity ok in Zope ( closes : #122 )
2006-09-30 06:39:51 +00:00
Federico Di Gregorio
4820213b7f
Fixed fractionary seconds >59 problem ( closes : #131 )
2006-09-30 06:35:12 +00:00
Federico Di Gregorio
bc580e3383
Fixed #129 .
2006-09-30 06:24:24 +00:00
Federico Di Gregorio
168d9c36af
Fractionary seconds fix ( closes : #130 )
2006-09-30 06:16:24 +00:00
Federico Di Gregorio
ca860424e6
Fixed lib/errorcodes.py.
2006-09-23 05:36:18 +00:00
Federico Di Gregorio
43518d067e
Added lib/errorcodes.py.
2006-09-23 05:35:03 +00:00
Federico Di Gregorio
1fe6269904
Piet Delport patches: final cleanup and PEP 353 macros.
2006-09-23 05:19:30 +00:00
Federico Di Gregorio
1d8af808bf
Piet Delport patches: 3 of 3.
2006-09-23 05:15:36 +00:00
Federico Di Gregorio
474d8b9d51
Piet Delport patches: 2 of 3.
2006-09-23 05:14:24 +00:00
Federico Di Gregorio
3009a29b11
Piet Delport patches: 1 of 3.
2006-09-23 05:10:58 +00:00
Fabio Tranchitella
49aa00d783
Updated the debian directory (debian release 2.0.5.1-1).
2006-09-19 03:53:10 +00:00
Fabio Tranchitella
146f64e71d
Added psycopg2da, the zope3 database adapter for psycopg2.
2006-09-19 03:50:35 +00:00
Federico Di Gregorio
52666ef5bd
Fixed syntax error in lib/extras.py.
2006-09-10 14:51:43 +00:00
Federico Di Gregorio
31189ef0df
Fixed syntax error in extras module ( closes : #123 ).
2006-09-10 14:50:03 +00:00
Federico Di Gregorio
a9d307140e
mx fix to build on win32.
2006-09-02 09:00:47 +00:00
Federico Di Gregorio
2007652589
mx fix to build on win32.
2006-09-02 09:00:39 +00:00
Federico Di Gregorio
dbd976bc03
Double mutex destroy fix.
2006-09-02 08:50:58 +00:00
Federico Di Gregorio
afaca71aa9
Double mutex destroy fix.
2006-09-02 08:50:30 +00:00
Federico Di Gregorio
269156d9bf
Added some file-like attributes to lobject.
2006-09-02 05:33:03 +00:00
Federico Di Gregorio
64bd7ae61c
Large objects landing..
2006-09-02 04:57:50 +00:00
Federico Di Gregorio
36785f753b
Work on large objects continue.
2006-09-01 17:15:27 +00:00
Federico Di Gregorio
0b9d13455d
Missing file.
2006-09-01 16:44:07 +00:00
Federico Di Gregorio
b8f3cef62f
psycopg is enlarging..
2006-09-01 16:27:02 +00:00
Federico Di Gregorio
64933f2004
Merge from 2_0_x branch up to r814.
2006-09-01 13:46:57 +00:00