summaryrefslogtreecommitdiff
path: root/src/interfaces
AgeCommit message (Collapse)Author
2001-01-26odbc1.diff changes the text on the Protocol Radio buttons on the driverBruce Momjian
dialogue from '6.4/6.5' to '6.5+' and removes some C++ comments from resource.h (which VC++ insists on putting there). odbc2.diff adds code to query the PostgreSQL version upon connection. This is then used to determine what values to return for from SQLGetInfo for SQL_DBMS_VER, SQL_MAX_ROW_SIZE, SQL_MAX_STATEMENT_LEN, SQL_OJ_CAPABILITIES and SQL_OUTER_JOINS. The version string as returned by SELECT vERSION() (as a char array) and the major.minor version number (as a flost) have been added to the ConnectionClass structure. Dave Page
2001-01-26gcc complains about improperly terminated comment.Tom Lane
2001-01-25Synced gram.y and preproc.y.Michael Meskes
2001-01-25Added an alternative constructor to PGSQLException so that debuggingPeter Mount
some more osteric bugs is easier. If only 1 arg is supplied and it's of type Exception, then that Exception's stacktrace is now included. This was done as there's been a report of an unusual bug during connection. This will make this sort of bug hunting easier from now on.
2001-01-25Further to the previous ODBC patches I posted today, I found a couple ofBruce Momjian
problems with char array sizes having set a couple of constants to 0 for unlimited query length and row length. This additional patch cleans those problems up by defining a new constant (STD_STATEMENT_LEN) to 65536 and using that in place of MAX_STATEMENT_LEN. Another constant (MAX_MESSAGE_LEN) was defined as 2*BLCKSZ, but is now 65536. This is used to define the length of the message buffer in a number of places and as I understand it (probably not that well!) therefore also places a limit on the query length. Fixing this properly is beyond my capabilities but 65536 should hopefully be large enough for most people. Apologies for being over-enthusiastic and posting 3 patches in one day rather than 1 better tested one! Regards, Dave Page
2001-01-25> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]Bruce Momjian
> Sent: 24 January 2001 16:51 > To: Dave Page > Subject: Re: [PATCHES] ODBC Patch for OJs/Large Querys & Rows > > > > SQL_OJ_LEFT = Left outer joins are supported. > > Yes. <snip> In addition to my earlier patch, this one adds support for SQLGetInfo SQL_OJ_CAPABILITIES to the ODBC driver. Dave Page
2001-01-25I decided to give this a go after all :-) The attached patch does theBruce Momjian
following but it does *not* check whether the user is connected to PostgreSQL 7.0.x or 7.1 first (as would be required for some of the features) - the driver doesn't do this at all afaik and it's beyond my capabilities to implement such checking in code that doesn't look like it was written by my 1 year old daughter! 1) The driver now reports no maximum query length (SQL_MAX_QUERY_SIZE). 2) The driver now reports no maximum row length (SQL_MAX_ROW_SIZE). 3) The driver now reports that Outer Joins are supported (SQL_OUTER_JOINS), but still does not report oj capabilities (SQL_OJ_CAPABILITIES). 4) The version number has been incremented to 7.1.0000 in psqlodbc.h *and* psqlodbc.rc Regards, Dave Page
2001-01-25This patch fixes an arrayindexoutofbounds exception that was justBruce Momjian
introduced into the code. The fix is a fix to org.postgresql.core.ByteArrayDim1.java. Barry Lind
2001-01-24Attached is a revised patch that removes the static SimpleDateFormatBruce Momjian
objects that Thomas pointed out might be a problem. PPS. I have included and updated the comments from the original patch request to reflect the changes made in this revised patch. > Attached is a set of patches for a couple of bugs dealing with > timestamps in JDBC. > > Bug#1) Incorrect timestamp stored in DB if client timezone different > than DB. > The buggy implementation of setTimestamp() in PreparedStatement simply > used the toString() method of the java.sql.Timestamp object to convert > to a string to send to the database. The format of this is yyyy-MM-dd > hh:mm:ss.SSS which doesn't include any timezone information. Therefore > the DB assumes its timezone since none is specified. That is OK if the > timezone of the client and server are the same, however if they are > different the wrong timestamp is received by the server. For example if > the client is running in timezone GMT and wants to send the timestamp > for noon to a server running in PST (GMT-8 hours), then the server will > receive 2000-01-12 12:00:00.0 and interprete it as 2000-01-12 > 12:00:00-08 which is 2000-01-12 04:00:00 in GMT. The fix is to send a > format to the server that includes the timezone offset. For simplicity > sake the fix uses a SimpleDateFormat object with its timezone set to GMT > so that '+00' can be used as the timezone for postgresql. This is done > as SimpleDateFormat doesn't support formating timezones in the way > postgresql expects. > > Bug#2) Incorrect handling of partial seconds in getting timestamps from > the DB > > When the SimpleDateFormat object parses a string with a format like > yyyy-MM-dd hh:mm:ss.SS it expects the fractional seconds to be three > decimal places (time precision in java is miliseconds = three decimal > places). This seems like a bug in java to me, but it is unlikely to be > fixed anytime soon, so the postgresql code needed modification to > support the java behaviour. So for example a string of '2000-01-12 > 12:00:00.12-08' coming from the database was being converted to a > timestamp object with a value of 2000-01-12 12:00:00.012GMT-08:00. The > fix was to check for a '.' in the string and if one is found append on > an extra zero to the fractional seconds part. > > > I also did some cleanup in ResultSet.getTimestamp(). This method has > had multiple patches applied some of which resulted in code that was no > longer needed. For example the ISO timestamp format that postgresql > uses specifies the timezone as an offset like '-08'. Code was added at > one point to convert the postgresql format to the java one which is > GMT-08:00, however the old code was left around which did nothing. So > there was code that looked for yyyy-MM-dd hh:mm:sszzzzzzzzz and > yyyy-MM-dd hh:mm:sszzz. This second format would never be encountered > because zzz (i.e. -08) would be converted into the former (also note > that the SimpleDateFormat object treats zzzzzzzzz and zzz the same, the > number of z's does not matter). > > > There was another problem/fix mentioned on the email lists today by > mcannon@internet.com which is also fixed by this patch: > > Bug#3) Fractional seconds lost when getting timestamp from the DB > A patch by Jan Thomea handled the case of yyyy-MM-dd hh:mm:sszzzzzzzzz > but not the fractional seconds version yyyy-MM-dd hh:mm:ss.SSzzzzzzzzz. > The code is fixed to handle this case as well. Barry Lind
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2001-01-24Removed the 8k row limit reported by DatabaseMetaDataPeter Mount
2001-01-23Subject: Bug in SQLForeignKeys()Bruce Momjian
Query used for checking foreign key triggers returns too many results when there're more than one foreign key in a table. It happens because only table's oid is used to link between pg_trigger with INSERT check and pg_trigger with UPDATE/DELETE check. I think there should be enough to add following conditions into WHERE clause of that query: AND pt.tgconstrname = pg_trigger.tgconstrname AND pt.tgconstrname = pg_trigger_1.tgconstrname /Constantin
2001-01-23Moved database name handling to libecpg.Michael Meskes
2001-01-22Synced preproc.y with gram.y and added missing include file to pgc.l.Michael Meskes
2001-01-20Get rid of sunos4-only strerror() macro, and arrange to use theTom Lane
implementation in backend/port/strerror.c if configure finds no strerror in libc, same as we do for snprintf and inet_aton.
2001-01-19Make pqexpbuffer a little more robust, per bug report from Heinz Ekker.Tom Lane
2001-01-19Fri Jan 19 08:47:00 GMT 2001 peter@retep.org.ukPeter Mount
- Applied patch submitted by John Schutz <schutz@austin.rr.com> that fixed a bug with ANT's SQL functions (not needed for building but nice to have fixed).
2001-01-18Forgot to cvs add UpdateableResultSet.java ;-)Peter Mount
2001-01-18Thu Jan 18 17:37:00 GMT 2001 peter@retep.org.ukPeter Mount
- Added new error message into errors.properties "postgresql.notsensitive" This is used by jdbc2.ResultSet when a method is called that should fetch the current value of a row from the database refreshRow() for example. - These methods no longer throw the not implemented but the new noupdate error. This is in preparation for the Updateable ResultSet support which will overide these methods by extending the existing class to implement that functionality, but needed to show something other than notimplemented: moveToCurrentRow() moveToInsertRow() rowDeleted() rowInserted() all update*() methods, except those that took the column as a String as they were already implemented to convert the String to an int. - getFetchDirection() and setFetchDirection() now throws "postgresql.notimp" as we only support one direction. The CursorResultSet will overide this when its implemented. - Created a new class under jdbc2 UpdateableResultSet which extends ResultSet and overides the relevent update methods. This allows us to implement them easily at a later date. - In jdbc2.Connection, the following methods are now implemented: createStatement(type,concurrency); getTypeMap(); setTypeMap(Map); - The JDBC2 type mapping scheme almost complete, just needs SQLInput & SQLOutput to be implemented. - Removed some Statement methods that somehow appeared in Connection. - In jdbc2.Statement() getResultSetConcurrency() getResultSetType() setResultSetConcurrency() setResultSetType() - Finally removed the old 6.5.x driver.
2001-01-18Thu Jan 18 12:24:00 GMT 2001 peter@retep.org.ukPeter Mount
- These methods in org.postgresql.jdbc2.ResultSet are now implemented: getBigDecimal(int) ie: without a scale (why did this get missed?) getBlob(int) getCharacterStream(int) getConcurrency() getDate(int,Calendar) getFetchDirection() getFetchSize() getTime(int,Calendar) getTimestamp(int,Calendar) getType() NB: Where int represents the column name, the associated version taking a String were already implemented by calling the int version. - These methods no longer throw the not implemented but the new noupdate error. This is in preparation for the Updateable ResultSet support which will overide these methods by extending the existing class to implement that functionality, but needed to show something other than notimplemented: cancelRowUpdates() deleteRow() - Added new error message into errors.properties "postgresql.noupdate" This is used by jdbc2.ResultSet when an update method is called and the ResultSet is not updateable. A new method notUpdateable() has been added to that class to throw this exception, keeping the binary size down. - Added new error message into errors.properties "postgresql.psqlnotimp" This is used instead of unimplemented when it's a feature in the backend that is preventing this method from being implemented. - Removed getKeysetSize() as its not part of the ResultSet API Thu Jan 18 09:46:00 GMT 2001 peter@retep.org.uk - Applied modified patch from Richard Bullington-McGuire <rbulling@microstate.com>. I had to modify it as some of the code patched now exists in different classes, and some of it actually patched obsolete code. Wed Jan 17 10:19:00 GMT 2001 peter@retep.org.uk - Updated Implementation to include both ANT & JBuilder - Updated README to reflect the changes since 7.0 - Created jdbc.jpr file which allows JBuilder to be used to edit the source. JBuilder _CAN_NOT_ be used to compile. You must use ANT for that. It's only to allow JBuilders syntax checking to improve the drivers source. Refer to Implementation for more details
2001-01-14Restructure backend SIGINT/SIGTERM handling so that 'die' interruptsTom Lane
are treated more like 'cancel' interrupts: the signal handler sets a flag that is examined at well-defined spots, rather than trying to cope with an interrupt that might happen anywhere. See pghackers discussion of 1/12/01.
2001-01-13Backed out:Bruce Momjian
--------------------------------------------------------------------------- Attached is a set of patches for a couple of bugs dealing with timestamps in JDBC. Bug#1) Incorrect timestamp stored in DB if client timezone different than DB.
2001-01-13Attached is a set of patches for a couple of bugs dealing withBruce Momjian
timestamps in JDBC. Bug#1) Incorrect timestamp stored in DB if client timezone different than DB. The buggy implementation of setTimestamp() in PreparedStatement simply used the toString() method of the java.sql.Timestamp object to convert to a string to send to the database. The format of this is yyyy-MM-dd hh:mm:ss.SSS which doesn't include any timezone information. Therefore the DB assumes its timezone since none is specified. That is OK if the timezone of the client and server are the same, however if they are different the wrong timestamp is received by the server. For example if the client is running in timezone GMT and wants to send the timestamp for noon to a server running in PST (GMT-8 hours), then the server will receive 2000-01-12 12:00:00.0 and interprete it as 2000-01-12 12:00:00-08 which is 2000-01-12 04:00:00 in GMT. The fix is to send a format to the server that includes the timezone offset. For simplicity sake the fix uses a SimpleDateFormat object with its timezone set to GMT so that '+00' can be used as the timezone for postgresql. This is done as SimpleDateFormat doesn't support formating timezones in the way postgresql expects. Bug#2) Incorrect handling of partial seconds in getting timestamps from the DB When the SimpleDateFormat object parses a string with a format like yyyy-MM-dd hh:mm:ss.SS it expects the fractional seconds to be three decimal places (time precision in java is miliseconds = three decimal places). This seems like a bug in java to me, but it is unlikely to be fixed anytime soon, so the postgresql code needed modification to support the java behaviour. So for example a string of '2000-01-12 12:00:00.12-08' coming from the database was being converted to a timestamp object with a value of 2000-01-12 12:00:00.012GMT-08:00. The fix was to check for a '.' in the string and if one is found append on an extra zero to the fractional seconds part. Bug#3) Performance problems In fixing the above two bugs, I noticed some things that could be improved. In PreparedStatement.setTimestamp(), PreparedStatement.setDate(), ResultSet.getTimestamp(), and ResultSet.getDate() these methods were creating a new SimpleDateFormat object everytime they were called. To avoid this unnecessary object creation overhead, I changed the code to use static variables for keeping a single instance of the needed formating objects. Also the code used the + operator for string concatenation. As everyone should know this is very inefficient and the use of StringBuffers is prefered. I also did some cleanup in ResultSet.getTimestamp(). This method has had multiple patches applied some of which resulted in code that was no longer needed. For example the ISO timestamp format that postgresql uses specifies the timezone as an offset like '-08'. Code was added at one point to convert the postgresql format to the java one which is GMT-08:00, however the old code was left around which did nothing. So there was code that looked for yyyy-MM-dd hh:mm:sszzzzzzzzz and yyyy-MM-dd hh:mm:sszzz. This second format would never be encountered because zzz (i.e. -08) would be converted into the former (also note that the SimpleDateFormat object treats zzzzzzzzz and zzz the same, the number of z's does not matter). There was another problem/fix mentioned on the email lists today by mcannon@internet.com which is also fixed by this patch: Bug#4) Fractional seconds lost when getting timestamp from the DB A patch by Jan Thomea handled the case of yyyy-MM-dd hh:mm:sszzzzzzzzz but not the fractional seconds version yyyy-MM-dd hh:mm:ss.SSzzzzzzzzz. The code is fixed to handle this case as well. Barry Lind
2001-01-09Synced preproc.y with gram.y.Michael Meskes
2001-01-06No need for screen_size to be static.Tom Lane
2001-01-05Remove not-really-standard implementation of CREATE TABLE's UNDER clause,Tom Lane
and revert documentation to describe the existing INHERITS clause instead, per recent discussion in pghackers. Also fix implementation of SQL_inheritance SET variable: it is not cool to look at this var during the initial parsing phase, only during parse_analyze(). See recent bug report concerning misinterpretation of date constants just after a SET TIMEZONE command. gram.y really has to be an invariant transformation of the query string to a raw parsetree; anything that can vary with time must be done during parse analysis.
2001-01-02I've found a memory leak in libecpg of PostgreSQL 7.0.3.Bruce Momjian
The leak is caused by the memory allocation in src/interfaces/ecpg/lib/execute.c in line 669 which is never freed. Adding a "free(array_query);" after PQexec in line 671 seems to fix the leak. Thorsten Knabe
2000-12-31On further thought, we need a defense against empty PGPORT here too.Tom Lane
2000-12-31Ignore PGPORT environment variable if it is an empty string.Tom Lane
2000-12-30Remove C++ comment.Peter Eisentraut
2000-12-30Fix unportable use of '!' in shell commands.Peter Eisentraut
2000-12-29column and tuple numbers should be int not size_t.Tom Lane
2000-12-28Attached are patches for two fixes to reduce memory usage by the JDBCBruce Momjian
drivers. The first fix fixes the PreparedStatement object to not allocate unnecessary objects when converting native types to Stings. The old code used the following format: (new Integer(x)).toString() whereas this can more efficiently be occompilshed by: Integer.toString(x); avoiding the unnecessary object creation. The second fix is to release some resources on the close() of a ResultSet. Currently the close() method on ResultSet is a noop. The purpose of the close() method is to release resources when the ResultSet is no longer needed. The fix is to free the tuples cached by the ResultSet when it is closed (by clearing out the Vector object that stores the tuples). This is important for my application, as I have a cache of Statement objects that I reuse. Since the Statement object maintains a reference to the ResultSet and the ResultSet kept references to the old tuples, my cache was holding on to a lot of memory. Barry Lind
2000-12-22- Fixed bug in a connect statement using varchars.Michael Meskes
- Synced parser.
2000-12-22Fix PQsetdbLogin() backward compatibility problem.Tatsuo Ishii
If pghost == "" and pgport == "" then PQsetdbLogin() fails with a error message: Is the postmaster running locally and accepting connections on Unix socket '/tmp/.s.PGSQL.0'? I see many applications such as PHP fails due to this behavior. Now if pgport == "", then it is assumed to be a DEF_PGPORT_STR. This is the same behavior as the version prior 7.1.
2000-12-22In looking at the 7.1beta1 code for JDBC, I noticed that support wasBruce Momjian
added to support character set encodings. However I noticed that the encoding that is used isn't obtained from the DB. Since Java uses unicode UCS2 internally the character set encoding is used to translate strings from/to the DB encoding. So it seems logical that the code would get the encoding from the DB instead of the current method of requiring the user pass it as a parameter. Attached is a patch that gets the DB encoding from the DB in the same manner as is done in libpq/fe-connect.c. The patch is created off of the latest CVS sources (Connection.java version 1.10). Barry Lind
2000-12-20Finished build.xml and updated Driver.java.in and buildDriver to match how ↵Peter Mount
Makefile and ANT operate.
2000-12-19Remove inclusions of <malloc.h>.Peter Eisentraut
2000-12-19Finally created ant build.xml filePeter Mount
2000-12-18Ensure that 'errno' is saved and restored by all signal handlers thatTom Lane
might change it. Experimentation shows that the signal handler call mechanism does not save/restore errno for you, at least not on Linux or HPUX, so this is definitely a real risk.
2000-12-18 - Synced gram.y and preproc.y.Michael Meskes
- Synced keyword.c. - Added several small patches from Christof.
2000-12-16Fix linker options for ODBC driver. See comment inPeter Eisentraut
src/interfaces/odbc/GNUmakefile.
2000-12-15Remove current->old mapping.Bruce Momjian
2000-12-15Change ET_WARN to ET_NOTICE to match internal codes, leave message asBruce Momjian
WARNING. Fix German FAQ mention about warning.
2000-12-15there is one problem with Zoltan patches commited into the tree:Bruce Momjian
if we set autocommit off and issued COMMIT (or ROLLBACK) on a connection new transaction is not started Max Khon
2000-12-11Make all ODBCVER = 2.50Bruce Momjian
2000-12-11Fix ODBC compile, prevent ODBCVER warning, though the version numbers goBruce Momjian
not match.
2000-12-10Here is patch to the ODBC driver to update the version to 2.5 and allowBruce Momjian
all forms of foreign keys be exposed to SQLForeignKeys. This patch is in addition to the ones I mailed yesterday (forget had I changed that as well....) Michael Fork - CCNA - MCP - A+ Network Support - Toledo Internet Access - Toledo Ohio
2000-12-10Here is a diff to info.c in interfaces/odbc that updates SQLForeignKeys toBruce Momjian
return foreign key information based on the pg_trigger system table. I have tested the patch with (what I believe) is all possible primary/foreign key combinations -- however I may have missed some, so if anyone feels like taking the patch for a test drive, here are some useful links: Michael Fork
2000-12-07Silence compiler warning.Tom Lane