Commit Graph

1024 Commits

Author SHA1 Message Date
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
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