Commit Graph

1876 Commits

Author SHA1 Message Date
Dave Cramer aa78ca3a95 added fix from Joel Hock to get the inserted row into the current buffer 2003-01-23 18:49:22 +00:00
Michael Meskes f8d8266ac5 Synced parser. 2003-01-21 20:01:12 +00:00
Barry Lind 56e6436c3a Bumped up build number to 200 2003-01-14 09:42:07 +00:00
Barry Lind feefc329bd Patch from Florian Wunderlich to correctly support java Timestamps. Previously
the code would only capture milliseconds where as both postgres and the java
Timestamp object support greater resolution.
Also fixed a bug reported by Rhett Sutphin where the last digit of the
fractional seconds was lost when using timestamp without time zone

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/test/jdbc2/TimestampTest.java
2003-01-14 09:13:51 +00:00
Barry Lind 9db065ba56 Patch from Aaron Mulder to have pooled connections implement PGConnection
Modified Files:
 	jdbc/org/postgresql/jdbc2/optional/PooledConnectionImpl.java
 	jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java
2003-01-14 05:46:49 +00:00
Barry Lind 88e524063a Patch from Kris Jurka to improve the performance of getImportedKeys().
Use explicit joins to avoid using the genetic query optimizer.  Also fixed
a regression test that was failing to compile.  This change also cleans up
how key names are reported as per:
A change to the value of the FK_NAME column.  Currently the returned value
is the triggers arguments which look like

"<unnamed>\000t2\000t1\000UNSPECIFIED\000a\000a\000"

This was required for server versions < 7.3 when a user did not supply
constraint names.  Every constraint was named "<unnamed>"
.  7.3 has enforced unique constraint names per table so unnamed foreign
keys will have different names "$1", "$2" and so on.  I've used logic
along the lines of the following to preserve the unique names in the
original scheme, but allow people who go to the trouble of naming their
constraints to see them:

if (triggerargs.startsWith("<unnamed>")) {
	fkname = [the whole ugly trigger args name originally used];
} else {
	fkname = [the actual fk name];
}

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
2003-01-14 05:05:26 +00:00
Peter Eisentraut 611278cc0b Clean ip.c. 2003-01-10 10:59:08 +00:00
Bruce Momjian b56af49849 The second was that renegotiation was just plain broken. I can't
believe I didn't notice this before -- once 64k was sent to/from the
server the client would crash.  Basicly, in 7.3 the server SSL code set
the initial state to "about to renegotiate" without actually starting
the renegotiation.  In addition, the server and client didn't properly
handle the SSL_ERROR_WANT_(READ|WRITE) error.  This is fixed in the
second patch.

Nathan Mueller
2003-01-08 23:18:25 +00:00
Bruce Momjian 6ccb5aebad I was playing around with 7.3.1 and found some more SSL problems. The
first, that I missed when checking over 7.3.1, was that the client
method was switched to SSLv23 along with the server.  The SSLv23 client
method does SSLv2 by default, but can also understand SSLv3.  In our
situation the SSLv2 backwords compatibility is really only needed on the
server.  This is the first patch.

The last thing is that I found a way for the server to understand SSLv2
HELLO messages (sent by pre-7.3 clients) but then get them to talk
SSLv3.  This is the last one.

Nathan Mueller
2003-01-08 22:56:58 +00:00
Bruce Momjian fe7f8f2b91 Fix pgpass to work with PQconnectDB().
Backpatch to 7.3.X.

Report from ljb.
2003-01-08 21:33:27 +00:00
Bruce Momjian 9270f1cdaa Only set the database name if we find a match in the services file. 2003-01-08 16:21:53 +00:00
D'Arcy J.M. Cain 6f14e2771a Correction to last patch. As per the DB-API spec, we need to return None
here, not -1.
2003-01-08 13:42:16 +00:00
Tom Lane 9f1f2bfb66 Fix various places where global s/NOTICE/WARNING/ was applied with too
much enthusiasm.
2003-01-07 22:23:17 +00:00
Bruce Momjian c859cda782 Document libpq service capability, and add sample file. 2003-01-07 04:25:29 +00:00
Bruce Momjian c9cf982038 Enable IPv6 libpq 'hostaddr' addresses. Update docs. 2003-01-06 22:48:16 +00:00
Bruce Momjian c3e9699f21 Enable IPv6 connections to the server, and add pg_hba.conf IPv6 entries
if the OS supports it.  Code will still compile on non-IPv6-aware
machines (feature added by Bruce).

Nigel Kukard
2003-01-06 03:18:27 +00:00
Tom Lane 699782b695 Adjust Tcl-related code to compile cleanly with Tcl 8.4 (add const modifiers as
needed).  Some desultory const-ification of SPI interface to support this.
2002-12-30 22:10:54 +00:00
Bruce Momjian d82794ee33 Attached is a patch to provide makefiles, etc. to allow the compilation
of the libpq interface static and dynamic libraries with the freely
downloadable Borland C++ compiler version 5.5 and/or C++ Builder.

Lester Godwin
2002-12-30 21:07:26 +00:00
Tom Lane 2e1f2c3109 Make use of TCL_INCLUDE_SPEC if available (it's new in Tcl 8.4, too bad
it took 'em this long to realize it's needed...)
2002-12-30 17:19:54 +00:00
Bruce Momjian e533e7dcf5 Add missing slash to python install path. 2002-12-30 05:06:50 +00:00
Dave Cramer 3daad2ae91 case sensitive updates by Kris Jurka 2002-12-23 16:12:36 +00:00
Dave Cramer e2ad5816e2 mike beachy's patch for statement handling 2002-12-20 14:10:34 +00:00
Dave Cramer 83feff3ee7 patch for null table in getPrimaryKeys 2002-12-20 13:15:53 +00:00
Bruce Momjian abf6f48319 pgindent fe-connect.c --- done to make IPv6 patch easier to apply. 2002-12-19 19:30:24 +00:00
PostgreSQL Daemon 750a0e676e From the SSL_CTX_new man page:
"SSLv23_method(void), SSLv23_server_method(void), SSLv23_client_method(void)

 A TLS/SSL connection established with these methods will understand the SSLv2,
 SSLv3, and TLSv1 protocol. A client will send out SSLv2 client hello messages
 and will indicate that it also understands SSLv3 and TLSv1. A server will
 understand SSLv2, SSLv3, and TLSv1 client hello messages. This is the best
 choice when compatibility is a concern."

This will maintain backwards compatibility for those us that don't use
TLS connections ...
2002-12-18 13:15:15 +00:00
Bruce Momjian 29cdab3d53 Increment libpq major number for 7.3.1 and minor for 7.4. 2002-12-13 22:17:57 +00:00
Bruce Momjian 88d639e6e8 Protect from null param on ecpg disconnect, verified by Roland Karch 2002-12-13 20:29:07 +00:00
Bruce Momjian d274105942 > There is an ugly little problem with the DB wrapper class.
>
> In pg.py the attributes of DB are defined as being the same as
> the attributes of the corresponding pgobject "db", using the following

...

> The problem is that the attributes of db (which are read only)
> are not static (they are actually function calls to PostgreSQL),
> especially "status" and "error", but those attributes are copied
> and this is done only once when initializing the DB object.
>
> So, in effect, only the attribute "db.error" of a DB instance
> will be updated, but not the attribute "error". Same with "status".


> Don't copy the (read only) attributes of the pgobject to the
> DB object, but only the methods, and all of them, like this:
>
> --------------- change in pg.py ------------------
> # Create convience methods, in a way that is still overridable.
> for e in self.db.__methods__:
>  setattr(self, e, getattr(self.db, e))
> ----------------------------------------------------
>
> Furthermore, make an addition to the documentation of the
> DB wrapper class (i.e. in pygresql-pg-db.html):
> After the sentence "All pgobject methods are included in this class also."
> add the following sentence "The pgobject read-only attributes can be
> accessed py adding the prefix 'db.' to them."

Christoph Zwerschke
2002-12-12 22:49:27 +00:00
Bruce Momjian 482ed836f7 Check SSL_get_error() value SSL_ERROR_SYSCALL to see if SSL_read()
returned -1, per SSL_get_error() documentation.

Nathan Mueller
2002-12-12 22:42:39 +00:00
Bruce Momjian 5587f077ab While porting my TPC-C implementation from Oracle, I discovered the
attached problem with the EXEC SQL COMMIT RELEASE statement.

Roland Karch
2002-12-12 21:50:01 +00:00
Dave Cramer d9d59ca65e patch for getTables to fix problems with backends before 7.3 by Kris Jurka 2002-12-11 21:02:58 +00:00
Dave Cramer 58eeb82cf8 Mike Beachy's build patch to allow ant builds without make 2002-12-11 12:29:13 +00:00
Dave Cramer a905eaacf0 Aaron's patch for Pooled Connections 2002-12-11 11:42:14 +00:00
Bruce Momjian 6ca16d7b80 Bump version for 7.3 and 7.4. 2002-12-11 04:07:39 +00:00
D'Arcy J.M. Cain be134e9dc4 Add an unnecessary assignment to remove a bogus warning. I checked the
logic carefully and I am sure that the test against n happens after it
is assigned to.
2002-12-10 11:43:44 +00:00
Bruce Momjian 38ffbb95d5 Back out V6 code, caused postmaster startup failure. 2002-12-06 04:37:05 +00:00
Bruce Momjian 8fc86dd593 We have just finished porting the old KAME IPv6 patch over to
postgresql version 7.3, but yea... this patch adds full IPv6
support to postgres. I've tested it out on 7.2.3 and has
been running perfectly stable.

CREDITS:
 The KAME Project  (Initial patch)
 Nigel Kukard  <nkukard@lbsd.net>
 Johan Jordaan  <johanj@lando.co.za>
2002-12-06 03:46:37 +00:00
Bruce Momjian 36580c8e21 PyGreSQL inserttable patch
=====================

I suggested an improvement of the inserttable in the PyGreSQL interface
already in January, but seemingly it was never implemented. I was told this
is the right place to get patches in for PyGreSQL, so I'm reposting my patch
here.

I consider the inserttable methode essential in populating the database
because of its benefits in performance compared to insert, so I think this
patch is quite essential. The attachment is an improved version of the
corresponding pg_inserttable function in pgmodule.c, which fixes the
following problems:

* The function raised exceptions because PyList_GetItem was used beyond the
size of the list. This was checked by comparing the result with NULL, but
the exception was not cleaned up, which could result in mysterious errors in
the following Python code. Instead of clearing the exception using
PyErr_Clear or something like that, I avoided throwing the exception at all
by at first requesting the size of the list. Using this opportunity, I also
checked the uniformity of the size of the rows passed in the lists/tuples.
The function also accepts (and silently ignores) empty lists and sublists.
* Python "None" values are now accepted and properly converted to PostgreSQL
NULL values
* The function now generates an error message in case of a line buffer
overflow
* It copes with tabulators, newlines and backslashes in strings now
* Rewrote the buffer filling code which should now run faster by avoiding
unnecessary string copy operations forth and back

Christoph Zwerschke
2002-12-06 03:19:28 +00:00
Dave Cramer caaf941070 changed sort of column names to sort by attnum, not attname 2002-12-05 01:11:43 +00:00
Bruce Momjian 5cdf45c6aa Stamp minor version numbers for 7.4 release. 2002-12-04 18:14:11 +00:00
D'Arcy J.M. Cain e3d7c9ba54 Remove typprtlen from getdescr() as it is not available in 7.3. Return -1 for
that field so that existing programs don't break.
2002-12-04 12:23:42 +00:00
Bruce Momjian 6f0ebe3fba Deal with cases where getpeereid _and_ another creditial method is
supported.
2002-12-03 22:09:20 +00:00
Michael Meskes b4e334b6e6 Synced parser with backend 2002-11-27 08:30:27 +00:00
Bruce Momjian 80e6d99731 Add -cmdTuples to tcl interface. 2002-11-26 21:38:49 +00:00
D'Arcy J.M. Cain 200dd8e3f8 I'm sending you a small patch to pgdb.py module. This
raises pgdb.DatabaseError when any of the fetch*
methods was invoked but previous call to execute* did
not produce any result set or no call was issued yet.
Also, raises pgdb.NotSupportedError when .nextset() is
invoked, instead of NameError.

This behaviour complies with DB-API 2.0.

Thanks for your work!

Timur Irmatov.
2002-11-25 03:11:15 +00:00
D'Arcy J.M. Cain a4bc5eeef2 Change the pkey method so that the caller can optionally set the dictionary
used for the primary key lookup.  This will prevent a database lookup
for each connection object that gets created.  This could be a significant
optimization on a busy system.

Similarly, the get_attnames method allows for the attributes dictionary
to be installed directly.
2002-11-25 02:15:13 +00:00
D'Arcy J.M. Cain f393ee0680 Change the debug variable to allow better control by the caller over how
debug output is managed.  The user can continue to use the current method
of passing a formatting string to have a replacement done and output will
be sent to the standard output exactly as it did before.  In addition they
can set it to a file object, sys.stderr for example, and the query string
will be printed to it.  Thay can also set it to a method (function) and the
query string will be passed to that method giving them the maximum flexibility
to do whatever they want with the query string.

I will be working with the PyGreSQL documentation shortly and at that time
will properly document this feature.
2002-11-25 01:28:32 +00:00
Bruce Momjian 1b7f3cc02d This patch implements FOR EACH STATEMENT triggers, per my email to
-hackers a couple days ago.

Notes/caveats:

        - added regression tests for the new functionality, all
          regression tests pass on my machine

        - added pg_dump support

        - updated PL/PgSQL to support per-statement triggers; didn't
          look at the other procedural languages.

        - there's (even) more code duplication in trigger.c than there
          was previously. Any suggestions on how to refactor the
          ExecXXXTriggers() functions to reuse more code would be
          welcome -- I took a brief look at it, but couldn't see an
          easy way to do it (there are several subtly-different
          versions of the code in question)

        - updated the documentation. I also took the liberty of
          removing a big chunk of duplicated syntax documentation in
          the Programmer's Guide on triggers, and moving that
          information to the CREATE TRIGGER reference page.

        - I also included some spelling fixes and similar small
          cleanups I noticed while making the changes. If you'd like
          me to split those into a separate patch, let me know.

Neil Conway
2002-11-23 03:59:09 +00:00
Barry Lind 1b80e0122f Fix a dumb cut and paste error from my last commit and update some of the
jdbc3 metadata responses

 Modified Files:
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java
2002-11-20 20:37:53 +00:00
Barry Lind 54bc3b6b8b Fixed bug reported by Marko Strukelj and Keith Wannamaker. Using executeBatch
on a preparedStatement would reset the prepared statment causing subsequent
uses of the preparedStatement to fail (i.e. the following series of calls
would fail: addBatch() executeBatch() addBatch() executBatch()).  This is
a regression from 7.2 where this worked correctly.  The regression test has
also been modified to explicitly test for this case.

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java
2002-11-20 07:34:32 +00:00