Commit Graph

1745 Commits

Author SHA1 Message Date
Bruce Momjian 6024ac1ba0 Back out old version and update with newer patch of:
Fix for non-blocking connections in libpq

Bernhard Herzog
2002-03-05 06:07:27 +00:00
Bruce Momjian a8bd7e1c6e > Tatsuo Ishii wrote:
> > > > It was made to cope with encoding such as an Asian bloc in 7.2Beta2.
> > > >
> > > > Added ServerEncoding
> > > >         Korean (JOHAB), Thai (WIN874),
> > > >         Vietnamese (TCVN), Arabic (WIN1256)
> > > >
> > > > Added ClientEncoding
> > > >         Simplified Chinese (GBK), Korean (UHC)
> > > >
> > > >
> > > >
> http://www.sankyo-unyu.co.jp/Pool/postgresql-7.2b2.newencoding.diff.tar.gz
> > > > (608K)
> > >
> > > Looks good.  I need some people to review this for me.
> >
> > For me they look good too. The only missing part is a
> > documentation. I will ask him to write it up. If he couldn't, I will
> > do it for him.
> > > The diff is 3mb
> > > but appears to address only additions to multibyte.  I have attached a
> > > list of files it modifies.  Also, look at the sizes of the mb/
> > > directory.  It is getting large:
> > >
> > >   4       ./CVS
> > >   6       ./Unicode/CVS
> > >   3433    ./Unicode
> > >   6197    .
> >
> > Yes. We definitely need the on-the-fly encoding addition capability:
> > i.e. CREATE CHRACTER SET in the future...
> > --
> > Tatsuo Ishii
> >
> >

Address chainge.

http://www.sankyo-unyu.co.jp/Pool/postgresql-7.2.newencoding.diff.gz

Add PsqlODBC and document ...etc patch.

Eiji Tokuya
2002-03-05 05:52:50 +00:00
Bruce Momjian 33766e680d Here's a patch against 7.1.3 that fixes a problem with sending larger
queries over non-blocking connections with libpq. "Larger" here
basically means that it doesn't fit into the output buffer.

The basic strategy is to fix pqFlush and pqPutBytes.

The problem with pqFlush as it stands now is that it returns EOF when an
error occurs or when not all data could be sent. The latter case is
clearly not an error for a non-blocking connection but the caller can't
distringuish it from an error very well.

The first part of the fix is therefore to fix pqFlush. This is done by
to renaming it to pqSendSome which only differs from pqFlush in its
return values to allow the caller to make the above distinction and a
new pqFlush which is implemented in terms of pqSendSome and behaves
exactly like the old pqFlush.

The second part of the fix modifies pqPutBytes to use pqSendSome instead
of pqFlush and to either send all the data or if not all data can be
sent on a non-blocking connection to at least put all data into the
output buffer, enlarging it if necessary. The callers of pqPutBytes
don't have to be changed because from their point of view pqPutBytes
behaves like before. It either succeeds in queueing all output data or
fails with an error.

I've also added a new API function PQsendSome which analogously to
PQflush just calls pqSendSome. Programs using non-blocking queries
should use this new function. The main difference is that this function
will have to be called repeatedly (calling select() properly in between)
until all data has been written.

AFAICT, the code in CVS HEAD hasn't changed with respect to non-blocking
queries and this fix should work there, too, but I haven't tested that
yet.

Bernhard Herzog
2002-03-05 05:20:12 +00:00
Dave Cramer 17b6baf17d Doug Fields patch to prevent exception being thrown on zero length arrays 2002-03-05 03:46:03 +00:00
Dave Cramer fe4e95f682 patch from Zhenbang Wei
The errors_zh_TW.properties must be translated using native2ascii or it
will raise an exception. Please replace the old file.
2002-03-05 03:33:29 +00:00
Dave Cramer 8f83590aa1 Patch from Ryouichi Matsuda
An attached patch corrects problem of this bug and fractional second.


 The handling of time zone was as follows:

   (a) with time zone
       using  SimpleDateFormat("yyyy-MM-dd HH:mm:ss z")
   (b) without time zone
       using  SimpleDateFormat("yyyy-MM-dd HH:mm:ss")


 About problem of fractional second,
 Fractional second was changed from milli-second to nano-second
2002-03-05 03:29:30 +00:00
Dave Cramer 7aa6270fc7 patch from Mitchel Friedman to fix getTables 2002-03-05 03:02:52 +00:00
Dave Cramer 521017c5d0 patch from Vicktor to fix Numeric decimal digits in getColumns 2002-03-05 02:14:08 +00:00
Bruce Momjian fef790cc03 Back out python patch:
Elliot Lee wrote:
> This patch to the python bindings adds C versions of the often-used
query
> args quoting routines, as well as support for quoting lists e.g.
> dbc.execute("SELECT * FROM foo WHERE blah IN %s", ([1,2,3],))
2002-03-05 02:01:44 +00:00
Bruce Momjian 14b05248cc This patch to the python bindings adds C versions of the often-used
query args quoting routines, as well as support for quoting lists e.g.
dbc.execute("SELECT * FROM foo WHERE blah IN %s", ([1,2,3],))

Elliot Lee
2002-03-05 00:23:13 +00:00
Bruce Momjian 294f0d4bd6 Add PQunescapeBytea libpq function.
Everyone using libpq and bytea is probably having to invent this wheel..

Patrick Welche
2002-03-04 23:59:14 +00:00
Bruce Momjian b2aade0e4b Improve libpgeasy API for multiple result sets, add example. 2002-03-04 18:50:21 +00:00
Tom Lane a616cbc5e3 Fix bogus error check in pg_execute, per report from lbayuk@mindspring.com. 2002-03-04 02:41:49 +00:00
Tom Lane 78ab803402 Don't bother to request SSL connection over a Unix socket, since the
postmaster won't accept the request anyway.  (If your kernel can't
be trusted, SSL will not help you.)
2002-03-02 00:49:22 +00:00
Hiroshi Inoue e1716475e4 Add files for Unicode support. 2002-03-01 07:18:34 +00:00
Hiroshi Inoue fc3726b4b9 Improve the handling of ODBC escape(a request from Marcelo Aceto).
Change SQLGetFunctions() to reply not yet implemented ODBC 3.0
functions precisely.
2002-02-27 01:43:24 +00:00
Dave Cramer 7776319a7e Implementation for cancelQuery by Grant Finnemore <grantf@guruhut.co.za> 2002-02-26 02:15:55 +00:00
Dave Cramer f66f7a542f compiles correctly but still doesn't work with jdk 1.4 2002-02-24 16:12:51 +00:00
Peter Eisentraut 42c3381fc7 Heimdal support (Kerberos V implementation from KTH) 2002-02-23 04:17:47 +00:00
Peter Eisentraut 0055a39390 Add -Wno-error to CFLAGS, so the rest of the tree can compile with
-Werror.
2002-02-23 04:16:04 +00:00
Dave Cramer 391e1f7b7f fixed compile error 2002-02-22 03:22:31 +00:00
Dave Cramer 8c17e4e0fc This patch fixes the exception thrown to inform the user the method
getColumnClassName(int) is not implemented. This will futher fixes method
ResultSet.getObject(int) since it requires the getColumnClassName(int) method to return the proper java class used to map the database column.

auther Ed Yu
2002-02-22 02:58:24 +00:00
Dave Cramer deaad93462 Patch from Cormac Twomey
fixes getIndexInfo throwing NullPointerException
fixes getIndexInfo improper results when multiple key indexs are used
2002-02-22 02:40:09 +00:00
Dave Cramer 0786c61c14 Patch from Cormac Twomey
fixes getIndexInfo throwing NullPointerException
fixes getIndexInfo improper results when multiple key indexs are used
2002-02-22 02:17:13 +00:00
Dave Cramer 178961ad47 now compiles clean with jdk 1.4 2002-02-22 02:07:30 +00:00
Hiroshi Inoue c03e7fbadc Remove compile warnings in multibute mode. 2002-02-18 05:54:50 +00:00
Hiroshi Inoue 3c16d095b5 The version is now 7.01.0010.
1) Handle parameter array.
2) Allow re-use of the connection handle after SQLDisconnect.
3) Reject NULL if no indicator specified.
4) Improve the handling of '_' in table name.
5) Unify internal begin/commit/abort operations.
6) Change SQLTables() to return null not "" for the
   table_owner.
7) Fix a bug about parameter handling reported by Benoit Menendez.
8) Add cast in handling ODBC date/time escape sequences.
9) Fix a bug about cache_size handing in declare/fetch mode.

[ODBC3.0 related]
10) Improve the handling of descriptor handles(ODBC3.0).
11) Improve the type handling of some types for ODBC3.0.

[Thanks to Marcelo Aceto for his useful patches]
12) Allow nested ODBC escape.
13) Allow changing autocommit on/off inside the transaction
    block.
14) Improve the handling of ODBC scalar functions.
2002-02-18 03:16:11 +00:00
Hiroshi Inoue b6db89a02d Separate info30.c from info.c. 2002-02-18 02:15:04 +00:00
Hiroshi Inoue 22d7fa7de4 Add files for ODBC3.0 support. 2002-02-18 01:43:24 +00:00
Bruce Momjian 4f5991552c Remove ODBC todo, add to main TODO. 2002-02-18 01:15:46 +00:00
Peter Eisentraut 673b48becb Remove warning about automatic inclusion of sqlca. 2002-02-15 17:46:57 +00:00
Peter Eisentraut 3ac85b86cb Update Win32-world version number of libpq++. 2002-01-30 21:59:33 +00:00
Michael Meskes cb8961ab47 Added patch to temporarily disable locale for descriptors too (Christof) 2002-01-23 16:34:06 +00:00
Tom Lane 04c8d4c660 libpq++/pgconnection.h must not include postgres_fe.h, else it fails to
compile in client apps that use the standard installed header set.
To allow removing that include, move DLLIMPORT definitions out of c.h
and into the appropriate port-specific header files.
2002-01-22 19:02:40 +00:00
Dave Cramer 83b5ae65a0 Fixes to getImportedKeys/getExportedKeys from Jason Davies
Previous versions did not correctly identify primary/foreign keys
2002-01-18 17:21:51 +00:00
Michael Meskes 2ab3a88879 Accept subsequent commits. This should have been just a warning anyway. I
cannot see a reason why it should be an error.
2002-01-18 15:51:00 +00:00
Barry Lind 2843a13e51 Applied patch submitted by Ryouichi Matsuda (r-matuda@sra.co.jp) that fixed a problem with leading zeros being lost on fractional seconds when setting a timestamp value on a PreparedStatement. 2002-01-15 07:37:33 +00:00
Barry Lind d013dbed75 Applied patch from Ryouichi Matsuda <r-matuda@sra.co.jp> where the jdbc
driver was not properly handling timestamptz datatype when using the
getObject() method on ResultSet.  Fix adds this datatype to the object mappings.
2002-01-15 06:55:13 +00:00
Tom Lane eab6776358 Ensure that ecpg/test is cleaned by higher-level 'make clean'. 2002-01-14 17:49:56 +00:00
Bruce Momjian d43b364eb9 Small AIX fixes from Rick Flower. 2002-01-14 15:34:41 +00:00
Michael Meskes 7138a1e5fc - Fixed variable handling for struct members.
- Removed check for array input. An attribut might store the
          complete array.
2002-01-13 08:52:09 +00:00
Michael Meskes 051a4f233f Added Christof's fixes. 2002-01-11 14:43:11 +00:00
Hiroshi Inoue d91b445117 *** empty log message *** 2002-01-11 06:01:47 +00:00
Hiroshi Inoue f43b5de649 Add a directory to save the changes until 7.3-tree is branched. 2002-01-11 02:50:01 +00:00
Michael Meskes 7955f98774 Include sqlca.h automatically. 2002-01-10 10:42:54 +00:00
Tom Lane 92a2598f97 The result of getopt() should be compared to -1, not EOF, per
pgsql-hackers discussion of this date.
2002-01-10 01:11:45 +00:00
Tom Lane d079c419d2 Fix include paths for case of VPATH build. 2002-01-09 00:06:42 +00:00
Tom Lane a34f313223 Fix copy-and-paste mistake exposed by gcc warning. 2002-01-08 23:34:47 +00:00
Peter Eisentraut 154ccb6040 Revert last change (CFLAGS+=-g). Probably was a mistake... 2002-01-08 20:41:28 +00:00
Tom Lane 61dd8b6dc4 Remove shift/reduce conflicts introduced by last change. 2002-01-08 19:02:51 +00:00
Michael Meskes 1e15f9e119 Fixed array pointers, no longer using void * in arithmetics. 2002-01-08 14:25:06 +00:00
Michael Meskes 54452833ef Fixed parser to accept initializing expressions starting with "(". 2002-01-07 16:25:45 +00:00
Peter Eisentraut 731204e090 Editorial review 2002-01-07 02:29:15 +00:00
Barry Lind 734e421278 Bugfix for bug reported by Marcus Better (marcus@dactylis.com). When preforming
a get on a bytea value the code was running the raw value from the server
through character set conversion, which if the character set was SQL_ASCII
would cause all 8bit characters to become ?'s.
2002-01-05 22:26:23 +00:00
Tom Lane ee051baeac Make sure that all <ctype.h> routines are called with unsigned char
values; it's not portable to call them with signed chars.  I recall doing
this for the last release, but a few more uncasted calls have snuck in.
2001-12-30 23:09:42 +00:00
Michael Meskes 988fdce5d1 - Removed space_or_nl and line_end from pgc.l.
- Fixed several bugs concerning arrays of structs including a memory
  allocation bug.
2001-12-23 12:17:41 +00:00
Peter Eisentraut cb85a62807 Czech translation updates from Karel Zak 2001-12-21 22:30:49 +00:00
Thomas G. Lockhart daefb89e5a Remove duplicate lines from fouled up last commit (my DSL line failed
during the CVS update, leaving locks and bad files).
2001-12-21 06:01:36 +00:00
Bruce Momjian f3292901b9 More comment for libpgeasy. 2001-12-14 02:15:04 +00:00
Bruce Momjian 2e05d3ecdb Fix double-memory free in libpgeasy; problem introduced yesterday. 2001-12-14 00:52:53 +00:00
Bruce Momjian bdafb40077 Clean up comment in libpgeasy. 2001-12-14 00:40:31 +00:00
Peter Eisentraut 3aaaf5aeee Add Swedish 2001-12-13 22:06:33 +00:00
Peter Eisentraut cfe88fdf4b update 2001-12-13 22:04:40 +00:00
Peter Eisentraut 60e42602a0 revert last change 2001-12-13 18:39:04 +00:00
Bruce Momjian ba578ae667 Free libpgeasy result structure on database close; fixed memory leak. 2001-12-13 09:40:18 +00:00
Barry Lind 3dd85bcb08 Applied patch from Thomas O'Dowd that fixes timestamp parsing. The jdbc code
wasn't updated to handle more than two decimal digits for fractional seconds
that now are possible in 7.2.  This patch fixes the timestamp parsing logic.
I have built and tested on both jdbc1 and jdbc2.
2001-12-11 04:48:05 +00:00
Barry Lind 45a6343ebb Patch from Ned Wolpert that fixes a bug that caused the cache of types not
to be used, causing extra sql statements to be executed.  This was a
significant performance problem with the database meta data classes.
The fix is a simple one liner.
2001-12-11 04:44:23 +00:00
Michael Meskes 0a7a8256b8 committed the missing files 2001-12-10 14:55:47 +00:00
Peter Eisentraut 3f1d142c59 Add French translation 2001-12-10 13:03:55 +00:00
Thomas G. Lockhart 9ed2ac291b Remove duplicate lines from previous patch attempt. Trouble with my
DSL line at home broke things right in the middle of an update. :(
2001-12-10 00:11:06 +00:00
Thomas G. Lockhart abbd64cddf Support ODBC-style CURRENT_TIME, CURRENT_USER, etc with trailing empty
parens. This is not SQL spec syntax, so later we will remove
 this extension from gram.y.
2001-12-10 00:01:14 +00:00
Michael Meskes a4420c4970 Fixed several bugs concerning indicators and added error messages instead of segfaults. 2001-12-09 15:27:49 +00:00
Michael Meskes d6fbb10556 Fix ecpg to allow pointer to structs. 2001-12-08 20:43:35 +00:00
Michael Meskes 9992f2b104 - Removed debug message from preproc.y.
- Fixed some bugs in exec sql var and exec sql type command.
2001-12-06 14:46:20 +00:00
Michael Meskes ee14711ce8 - Fixed variable handling in AT statement.
- Fixed bug that caused segfault when given incorrect DB name.
        - Fixed bug in ecpglib causing indicator to list the size of the
          variable instead of the size of the data.
2001-12-05 15:32:07 +00:00
Michael Meskes 388008cdd7 Fixed dumping of structs without indicators. 2001-12-04 12:33:15 +00:00
Tom Lane 4ea2b8f556 Pg_lo_open must OR together multiple modes, not AND them. Per report
from Andreas Kretzer.
2001-12-03 14:49:46 +00:00
D'Arcy J.M. Cain d75ed09b31 Bump version to 3.3. Mostly this is because there is some confusion about
the latest version and I wanted to make sure that there was a clean release.

I also change the build files as I discussed in my letter of Nov 6, 2001.  At
the time I was asked to hold off until after the release.
2001-12-03 12:39:44 +00:00
Tom Lane ae8a9b8a9f Remove code to lookup WinSock error strings in netmsg.dll; according to
Magnus Hagander that DLL only contains error strings for the Net***
functions, *not* WinSock.  We need to look for a workable solution for
older Windows flavors ... but it won't happen for PG 7.2.
2001-12-03 00:28:24 +00:00
Peter Eisentraut 15abc7788e More correct way to check for existence of types, which allows to specify
which include files to consider.  Should fix BeOS problems with int8 types.
2001-12-02 11:38:40 +00:00
Peter Eisentraut ad81c99984 Update since left and right are no longer key words. 2001-12-02 11:36:04 +00:00
Peter Eisentraut 0556f7ca87 NLS updates, most notably fixed zh_TW translations 2001-11-29 18:59:28 +00:00
Tom Lane 3312b8ed3c Load netmsg.dll locally in winsock_strerror, to avoid actual and
potential problems discussed in pgsql-interfaces.
2001-11-28 19:40:29 +00:00
Bruce Momjian f6e1ebb166 No longer need define test in md5.h because of Hiroshi's win_md5.c. 2001-11-28 00:16:53 +00:00
Tom Lane b3ff03b5d4 strcat should obviously be strcpy here. 2001-11-27 18:21:51 +00:00
Bruce Momjian 0f74fb7871 Chinese PO patch
Laser.
2001-11-27 17:51:54 +00:00
Barry Lind 4bc8c8dd95 This patch fixes a bug reported by Graham Leggett (minfrin@sharp.fm).
The bug was that any insert or update would fail if the returned oid was
larger than a signed int.  Since OIDs are unsigned int's it was
a bug that the code used a java signed int to deal with the values.  The bug
would result in the error message: "Unable to fathom update count".
While fixing the bug, it became apparent that other code made a similar
assumption about OIDs being signed ints.  Therefore some methods that returned
or took OIDs are arguements also needed to be changed.
Since we are so close to the 7.2 release I have added new methods that
return longs and deprecated the old methods returning ints.  Therefore all
old code should still work without requiring a code change to cast from long to int.  Also note that the methods below are PostgreSQL specific extensions to
the JDBC api are are not part of the spec from Sun, thus it is unlikely that
they are used much or at all.

The deprecated methods are:
  ResultSet.getInsertedOID()
  Statement.getInsertedOID()
  Serialize.store()
  Connection.putObject()
and are replaced by:
  ResultSet.getLastOID()
  Statement.getLastOID()
  Serialize.storeObject()
  Connection.storeObject()
All the deprecated methods returned int, while their replacements return long

This patch also fixes two comments in MD5Digest that the author Jeremy Wohl
submitted.

--Barry
2001-11-25 23:26:59 +00:00
Hiroshi Inoue 535d92877e Remove compile errors of psql.exe and libpq.dll under
Multibyte mode.
2001-11-22 10:18:52 +00:00
Tom Lane 6c134eb6f1 Spell 'precedes', 'preceding' correctly in various places. 2001-11-21 22:57:01 +00:00
Bruce Momjian 16cb347eee // -> /* */, per Tatsuo. 2001-11-21 05:03:16 +00:00
Bruce Momjian 28e92b89f4 Change 'return ;' to 'return;'; remove space. 2001-11-19 23:19:21 +00:00
Bruce Momjian 09634eafe1 Indent jdbc case labels using pgjindent. 2001-11-19 23:16:46 +00:00
Bruce Momjian 6c8120d68c More jdbc comment cleanups. Code looks very nice now. 2001-11-19 22:43:13 +00:00
Bruce Momjian f3148bef9f JDBC indenting, comment cleanups. 2001-11-19 22:33:39 +00:00
Hiroshi Inoue 09a2b4f423 Fix comment at top of file to match file name. 2001-11-19 06:26:00 +00:00
Tom Lane 9b03776ff2 A bunch of small doco updates motivated by scanning the comments on
the interactive docs.
2001-11-19 03:58:25 +00:00
Bruce Momjian 09bf48cf79 Improve comments about duplicate files. 2001-11-18 23:02:19 +00:00
Bruce Momjian aea081bb27 Add missing prototype. 2001-11-16 18:28:16 +00:00
Bruce Momjian 07de4cbbbb Add configure result checks on odbc, per Peter E. 2001-11-16 18:10:04 +00:00
Tom Lane 100e7f0c9d Once again, Michael has overwritten someone else's patch ... 2001-11-16 17:01:48 +00:00
Peter Eisentraut aff53b27f0 Make the yacc rules safe for parallel make. See discussion on pgsql-patches
and comment in src/backend/parser/Makefile for the technical details.
2001-11-16 16:32:33 +00:00
Michael Meskes 7845954e49 Committed again to add the missing files/patches. 2001-11-16 08:36:37 +00:00
Hiroshi Inoue 949af991fc Change SQLDescribeCol so that it returns alias name properly. 2001-11-16 05:55:10 +00:00
Tom Lane 2a4660f5aa Update keyword lists per suggestions by Peter. There are now four
mutually exclusive keyword lists spanning all known keywords ---
including AS.  Moved COALESCE and a few other ColLabels into the
can-be-ColId list.
2001-11-16 04:08:33 +00:00
Bruce Momjian 2c1784a9c7 Update md5.h because it can't get the value from configure. 2001-11-15 16:16:08 +00:00
Bruce Momjian 1edbd62cac Fix comment at top of file to match file name. 2001-11-15 03:12:53 +00:00
Dave Cramer 80c029190f fixes getIndex to work with forte's transparent persistence 2001-11-14 20:04:00 +00:00
Michael Meskes 32a4c3008f Added Christof's patches. 2001-11-14 11:11:49 +00:00
Barry Lind ebb93323bb Attached is a patch against the CVS repository that fixes the ResultSet absolute() problem.
There's also a little fix for the getRow() method. While fixing
absolute(), I noticed that getRow() wasn't quite following the spec: it
wasn't returning 0 when the ResultSet wasn't positioned on a row.  I've
started a ResultSet test case and included it as well.

Liam Stewart
2001-11-14 04:11:37 +00:00
Bruce Momjian c97a787e85 Update CVS tags. 2001-11-13 22:08:04 +00:00
Bruce Momjian 2ca65f716a Remove md5.c check, add CVS log stamp. Update comments. 2001-11-13 22:06:58 +00:00
Barry Lind 7a9ef7ee09 fixed bug in ResultSet. Version 1.29 backed out two previous fixes (1.26 and 1.25). This checkin add back those two previous fixes. Problem reported by Daniel Germain 2001-11-12 19:59:46 +00:00
Barry Lind 3a306eefe9 Commit to support MD5 passwords as per the backend for 7.2. This patch was submitted by Jeremy Wohl jeremyw-pgjdbc@igmus.org 2001-11-12 19:11:56 +00:00
Bruce Momjian 67a56f2286 Sync up both files. 2001-11-12 02:05:17 +00:00
Bruce Momjian 36bbb2494e Add comments and remove CVS tag from md5.c so they remain identical. 2001-11-12 01:59:43 +00:00
Bruce Momjian 0611d3980a Update md5 to match. 2001-11-12 01:56:12 +00:00
Hiroshi Inoue b52950cc3d Add md5 authentication support thanks to Bruce Momjian. 2001-11-12 00:54:28 +00:00
Hiroshi Inoue 8bf1e098dd Use abbreviated connection string more widely.
This seems to fix the trouble with PowerBuilder
reported by Magbus Weber.
2001-11-11 07:24:36 +00:00
Tom Lane 15c21bf8e1 Defend against possibility that SSL error reporting mechanism returns
a NULL pointer.  Per report from Stephen Pillinger 8-Nov-01.
2001-11-11 02:09:05 +00:00
Tom Lane ec438886e1 Allow TIMESTAMP, VARCHAR, et al to be used as unquoted column names,
though alas not as unquoted function names.  De-reserve a bunch of
keywords that could have been in ColId rather than ColLabel all along.
Per recent proposal in pgsql-patches.
2001-11-10 22:31:49 +00:00
Dave Cramer be4e5059a2 Jason Davies patch to getImported/getExported keys 2001-11-09 02:57:50 +00:00
Bruce Momjian 77e4fd889c Fix indenting for 'extern "C"' cases. 2001-11-08 20:37:52 +00:00
Tom Lane 64af43a15f Add casts to suppress compiler warnings observed on Darwin platform
(surprised no one has reported these yet...)
2001-11-08 04:05:13 +00:00
Bruce Momjian e7c788f3a0 Some post pgident run updates,
one fuzzy translation fix, some
other messages tweaking. Theoretically,
should be up-to-date by now.

Please apply to /src/interfaces/libpq/ru.po

--
Serguei A. Mokhov
2001-11-07 03:09:15 +00:00
Bruce Momjian ea08e6cd55 New pgindent run with fixes suggested by Tom. Patch manually reviewed,
initdb/regression tests pass.
2001-11-05 17:46:40 +00:00
Hiroshi Inoue 34153b2052 Preparation for the parameter array handling. 2001-11-05 10:35:14 +00:00
Hiroshi Inoue c0b27c4feb 1) Fix a few bugs about SQLGetData()
reported by Mika Mantyla.
2) Timestamp precision.
3) Separate ODBC3.0 files.
2001-11-05 09:46:17 +00:00
D'Arcy J.M. Cain 568cb6ab5c Version was 3.3 but last released version was 3.1. Setting to match rest
of the documentation in preparation for upcoming release.
2001-11-04 20:11:01 +00:00
D'Arcy J.M. Cain 5f067722bf Note that PyGreSQL has been checked against Python 2.1 now. 2001-11-04 19:47:16 +00:00
D'Arcy J.M. Cain 6395d86a9a The "%d", while syntactically correct, was confusing. Added a space to
make it clearer that d was the argument to the format operator.
2001-11-04 19:42:13 +00:00
Hiroshi Inoue 58df3f785e 1) Improve literal handling in parse_statement().
2) Remove some no longer valid comments.
3) Fix an option dialog setting bug.
4) Fix ODBCVER handling errors.
2001-11-03 06:53:50 +00:00
Dave Cramer 355cc69dfc proper select for Jason Davies patch to getImportedKeys 2001-11-02 23:51:18 +00:00
Dave Cramer 0b1289e67d proper select for Jason Davies patch to getImportedKeys
fixes for compiling Jason's getImportedKeys, getExportedKeys
2001-11-02 23:50:08 +00:00
Tom Lane c42d3b3c24 Windows portability macros SOCK_ERRNO and SOCK_STRERROR should be in
libpq-int.h, not cluttering application namespace in libpq-fe.h.
2001-11-02 20:51:27 +00:00
Peter Eisentraut a9b6691ae7 updates 2001-11-02 19:16:47 +00:00
Tom Lane 6babf6eab7 Suppress compiler warning (only seen in MULTIBYTE case). 2001-11-02 17:00:18 +00:00
Michael Meskes 5d4b94085e Sync parser yet again. 2001-11-02 15:04:03 +00:00
Barry Lind 8304a395f9 minor improvements on Dave's last checkin 2001-11-01 01:10:13 +00:00
Hiroshi Inoue 01da8e918d Suppress a compiler warning. 2001-10-31 23:54:02 +00:00
Dave Cramer 1da3771b4e changes to support 3rd party ERD tools and staroffice 2001-10-31 20:27:37 +00:00
Dave Cramer af000b7f2e allow null passwords 2001-10-31 20:26:01 +00:00
Dave Cramer 29916087d0 added dummy login 2001-10-31 20:24:32 +00:00
Bruce Momjian 85817580f4 Traditional Chinese error messages for JDBC.
Zhenbang Wei
2001-10-31 04:55:02 +00:00
Bruce Momjian 4911c85e86 Add ALTER TABLE ADD UNIQUE regression tests from Christopher Kings-Lynne.
Add space between slash for ALTER TABLE / ADD ....

Regression and *.po updates to follow.
2001-10-31 04:49:44 +00:00
Bruce Momjian 74c2f8e729 Apply updated PO language patch.
Zhenbang Wei
2001-10-31 04:31:17 +00:00
Bruce Momjian 41b161f0eb PO language update.
forth@pagic.net
2001-10-31 04:20:26 +00:00
Barry Lind 512a3aef36 fixed change in behavior introduced in bytea / getBytes changes. This patch reverts back unintentional change in behavior to return raw value even when not bytea column 2001-10-30 06:31:59 +00:00
Bruce Momjian c41b6b1b9c Fix small problem Tom Lane found with pgindent run. 2001-10-30 05:38:56 +00:00
Barry Lind d650a6f580 updated patch from Mark Lillywhite per Tom Lane's comments: subtract VARHDRSZ first then and with 0xffff 2001-10-30 05:09:51 +00:00
Barry Lind d80d4baa09 applied patch from Mark Lillywhite, patch was already applied to jdbc2, this applies same fix to jdbc1 code 2001-10-30 05:05:25 +00:00
Hiroshi Inoue aaf95b6c86 Change position of a check button in multibyte mode. 2001-10-29 02:51:46 +00:00
Bruce Momjian 6783b2372e Another pgindent run. Fixes enum indenting, and improves #endif
spacing.  Also adds space for one-line comments.
2001-10-28 06:26:15 +00:00
Tom Lane 40ce3a93f1 Remove 294 reduce/reduce conflicts. 2001-10-25 20:56:53 +00:00
Bruce Momjian d2e27b0674 pgjindent jdbc files. First time jdbc files were formatted. 2001-10-25 06:00:05 +00:00
Bruce Momjian b81844b173 pgindent run on all C files. Java run to follow. initdb/regression
tests pass.
2001-10-25 05:50:21 +00:00
Bruce Momjian fde8edaf53 Add do { ... } while (0) to more bad macros. 2001-10-25 01:29:37 +00:00
Bruce Momjian 309a04f5b8 Add missing "do { ... } while(0)" in ODBC macros and add find_baddefs
script.
2001-10-25 00:50:50 +00:00
Bruce Momjian cabe9896bc Here is a patch for DatabaseMetaData to show precision properly. It is
from Mark Lillywhite.  I am adding to the patch queue.
2001-10-24 17:44:28 +00:00
Barry Lind 97ab49beb0 fix for a bug in DatabaseMetaData.getIndexInfo(). This fixes a bug reported by tom_falconer@lineone.net. On Sept 7th, he sent a test case to the list demonstrating the bug. His test case now works successfully with this patch 2001-10-24 04:31:50 +00:00
Michael Meskes e97fe98c36 synced preproc.y with gram.y 2001-10-22 17:05:56 +00:00
Bruce Momjian ece1b67f54 > This stops the interface from leaking the row tuples (and thus the
> results of every fetch).

Stephen Robert Norris
2001-10-19 15:00:26 +00:00
Michael Meskes a535cd1f8b removed "not fully implemented" warning for nullif 2001-10-19 14:31:44 +00:00
Hiroshi Inoue 8c3cb43bac Change SC_fetch() to not retrieve data in case the
SQL_RETRIEVE_DATA option is SQL_RD_OFF. This would
avoid a crash when scrolling Grid controls.
2001-10-19 05:39:14 +00:00
Bruce Momjian 278669e038 Document all the ecpg error codes. 2001-10-18 20:32:58 +00:00
Thomas G. Lockhart 9310075a13 Accept an INTERVAL argument for SET TIME ZONE per SQL99.
Modified the parser and the SET handlers to use full Node structures
 rather than simply a character string argument.
Implement INTERVAL() YEAR TO MONTH (etc) syntax per SQL99.
 Does not yet accept the goofy string format that goes along with, but
 this should be fairly straight forward to fix now as a bug or later
 as a feature.
Implement precision for the INTERVAL() type.
 Use the typmod mechanism for both of INTERVAL features.
Fix the INTERVAL syntax in the parser:
 opt_interval was in the wrong place.
INTERVAL is now a reserved word, otherwise we get reduce/reduce errors.
Implement an explicit date_part() function for TIMETZ.
 Should fix coersion problem with INTERVAL reported by Peter E.
Fix up some error messages for date/time types.
 Use all caps for type names within message.
Fix recently introduced side-effect bug disabling 'epoch' as a recognized
 field for date_part() etc. Reported by Peter E. (??)
Bump catalog version number.
Rename "microseconds" current transaction time field
 from ...Msec to ...Usec. Duh!
date/time regression tests updated for reference platform, but a few
 changes will be necessary for others.
2001-10-18 17:30:21 +00:00
Michael Meskes 5045004958 Added Lee Kindness' patches. 2001-10-18 11:01:35 +00:00
Barry Lind bf737b859f Updated the list of encodings supported to match what the backend now supports 2001-10-16 20:07:17 +00:00
Barry Lind f50793c743 Added some additional comments in the code 2001-10-16 20:05:22 +00:00
Bruce Momjian 076026bba9 Python handle as string all int8 values from postgresql. This could be
view when using the aggregate function count() and function nextval
that returns an int8 value, but in python is represented like string:

>> db.query("select nextval('my_seq')").getresult()
[('2',)]

>> db.query("select count(*) from films").dictresult()
[{'count': '120'}]



Ricardo Caesar Lenzi
2001-10-16 13:42:57 +00:00
Tom Lane e158670c1f Doesn't anyone test stuff before they commit it? 2001-10-15 20:15:09 +00:00
Bruce Momjian 394925b60d > Uh, isn't the correct fix
> ! $$ = cat_str(8, make_str("grant"), $2, make_str("on"), $4, $5,
 > make_str("to"), $7, $8);
 > ISTM your patch loses the opt_with_grant clause.  (Of course the
 > backend doesn't currently accept that clause anyway, but that's no
 > reason for ecpg to drop it.)

My patch doesn't loose the option, it's never been passed on anyway:

 opt_with_grant:  WITH GRANT OPTION
                                {
                                        mmerror(ET_ERROR, "WITH GRANT OPTION is not supported.  Only relation owners can
 set privileges");
                                 }
                | /*EMPTY*/
                ;

The existing code in ecpg/preproc/preproc.y to handle the WITH option
simply throws an error and aborts the processing... The patch below
prevents the segfault and also passes on the WITH option to the
backend, probably a better fix.

Lee Kindness
2001-10-15 18:16:31 +00:00
Tom Lane e3b3eb20a4 Synchronize with main parser's keyword list (someone didn't check his
last commit very carefully...)
2001-10-15 00:06:04 +00:00
Michael Meskes 1ebc028cbc - Fixed GRANT statement.
- Synced preproc.y with gram.y.
2001-10-14 12:07:57 +00:00
Peter Eisentraut d1c6983899 Fix logic in insert() function. 2001-10-13 19:16:32 +00:00
Hiroshi Inoue 0420342af1 Update the version of psqlodbc driver. 2001-10-12 09:41:49 +00:00
Hiroshi Inoue 9d13fcf0af Fix the bug reported by Chris Lee. 2001-10-12 01:08:51 +00:00
Peter Eisentraut ec5c62874d Allow optional () after current_user, session_user, user, current_time,
current_timestamp, current_date for ODBC compatibility.

Add more functions to odbc.sql catalog extension, use new CREATE OR
REPLACE FUNCTION.

Document iODBC/unixODBC build options.
2001-10-09 22:32:33 +00:00
Barry Lind 839b9bc011 This patch fixes a bug introduced in the jdbc bytea support patch.
That patch broke the ability to read data from binary cursors.
--Barry Lind
 Modified Files:
 	pgsql/src/interfaces/jdbc/org/postgresql/Connection.java
 	pgsql/src/interfaces/jdbc/org/postgresql/ResultSet.java
 	pgsql/src/interfaces/jdbc/org/postgresql/core/QueryExecutor.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Connection.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Connection.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java
 	pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/UpdateableResultSet.java
2001-10-09 20:47:35 +00:00
Michael Meskes 6d5be886bc Fix include file so library is binary compatible again. 2001-10-08 08:08:42 +00:00
Bruce Momjian ee973be9c2 files attached are Traditional Chinese translations translated
and modified from Simplified Chinese translations for backend,
pgsql, pg_dump and libpq. I've appended their names to zh_TW.po.

forth
2001-10-05 19:05:54 +00:00
Michael Meskes b78efb6d82 Make sure each call to ECPGraise is logged. 2001-10-05 17:37:07 +00:00
Michael Meskes c83137a025 Fixed typo in proproc.y 2001-10-05 06:39:23 +00:00
Bruce Momjian 60553337d7 Attached is a patch which deals with
select 'id' as xxx from table

The issue is:

When the driver gets a data type which does not map into the SQL.Types
it attempts to load the object into a java object. Eventually throwing
an exception indicating that the type "unknown" was not found.

Since the backend defaults "unknown" types to text it was suggested that
the jdbc driver do the same.

This patch does just that.

I have tested it on the above select statement as well as a small
program that serializes, and deserializes a class

Dave Cramer
2001-10-04 15:46:49 +00:00
Bruce Momjian a6020b396b I've just finished the Chinese NLS support(zh_CN part) files
translation,
    the attachement is those four files.
   (.tar.gz file, with the directory, root is $PGSRC).
    Tested on some Linux platform.

Weiping He
2001-10-04 15:44:14 +00:00
Tom Lane fcd2e372a7 Consistently use gcc's __attribute__((format)) to check sprintf-style
format strings wherever possible.  Remarkably, this exercise didn't
turn up any inconsistencies, but it seems a good idea for the future.
2001-10-03 21:58:28 +00:00
Tom Lane 2e5fda7b7e DROP AGGREGATE and COMMENT ON AGGREGATE now accept the expected syntax
'aggname (aggtype)'.  The old syntax 'aggname aggtype' is still accepted
for backwards compatibility.  Fix pg_dump, which was actually broken for
most cases of user-defined aggregates.  Clean up error messages associated
with these commands.
2001-10-03 20:54:22 +00:00
Tom Lane f2c657375d Add CREATE OR REPLACE FUNCTION syntax to allow replacing a function
definition without changing the function's OID, thereby not breaking
rules, views, triggers, etc that depend on it.  From Gavin Sherry.
2001-10-02 21:39:36 +00:00
Michael Meskes fecbeedc7e Re-added Tom's patch fixing my setlocale patch. I accidently
deleted it.
2001-10-02 14:08:28 +00:00
Michael Meskes 9f09e8362b - Fixed truncate bug.
- Added patch by Christof Petig <christof.petig@wtal.de> to
clean up
ecpglib.
2001-10-01 12:02:28 +00:00
Tom Lane 95d4821b1c Make libpq++ safe again for older C++ compilers. Do 'using namespace std'
only if configure found it was safe to do so; do not assume const_cast
is available.
2001-09-30 22:30:37 +00:00
Tom Lane 12054ba506 Fix sloppiness about static vs non-static declaration of functions.
Some compilers are pickier about this than gcc is.
2001-09-30 21:48:58 +00:00
Tom Lane 650c175042 winsock_strerror crashed on me. This fixes a line of code that looks
cleverer than it actually is ;-) Braces are good for you :-)

Gerhard HÌring
2001-09-30 16:23:30 +00:00
Tom Lane dc05a996c5 Fix the setlocale problem in a way that actually works. setlocale
returns a string corresponding to the new setting, not the old,
therefore the previous patch was quite wrong.
2001-09-29 20:12:07 +00:00
Bruce Momjian 850ba41677 A couple of lines were missing from my last patch - this one fixes things.
Liam Stewart
2001-09-29 03:11:11 +00:00
Bruce Momjian 07ce9fe61d Per the recent discussion there's been some code changes in JDBC's
DatabaseMetaData.getColumn(). I proposed a patch that would change the
number of queries to find out all columns in a table from 2 * N + 1 to 1 (N
being the number of columns reported) by using some outer joins. I also
fixed the fact that getColumns() only returned columns that had a default
defined. OTOH, I did not use to change the code required for obtaining a
column's remarks (by using col_description() for 7.2  and requested by Tom
Lane).

Finally, I have found a way to get all the column details in a single query
*and* use col_description() for 7.2 servers. A patch is attached. It
overrules Ren? Pijlman's fix for this that was committed just today, but
still used N + 1 queries (sorry Ren? ;-) )

I also fixed the return values for TABLE_CAT and TABLE_SCHEM from "" to
null, to be more standard compliant (and requested in Ren?'s mail found at
http://fts.postgresql.org/db/mw/msg.html?mid=1034253).

As always, the JDBC1 version has not been tested as I have no JDK 1.1

Jeroen van Vianen
2001-09-29 03:08:01 +00:00
Hiroshi Inoue 5b328502b5 Fix the bug about boolean type handling reported by
Kristis Markis.
2001-09-29 02:48:04 +00:00
Bruce Momjian be83aac6d2 Disable local creds on OpenBSD because it doesn't support it. Document
supported platforms in pg_hba.conf.
2001-09-26 19:54:12 +00:00
Michael Meskes 16b9b75876 - Synced preproc.y with gram.y.
- Changed locale handling.
2001-09-25 18:37:17 +00:00
Hiroshi Inoue 2df4087a70 1) Fix compile errors on Windows.
2) Change *Common* --> *Default*.
2001-09-24 00:05:59 +00:00
Peter Eisentraut 091a7659d4 Don't refer to odbcinst.ini by absolute path. SQLGetPrivateProfileString
handles this.

Don't install our own odbcinst.ini.  That's the driver manager's business.
2001-09-23 13:32:24 +00:00
Bruce Momjian b75814aee3 The attached patch is my first run-through of the JDBC test suite. A
summary of changes:

 . removal of the tablename property from build.xml

 . addition of a dropTable method in JDBC2Tests and cleanups of many
methods in the same

 . all tests now use non-deprecated assertXYZ methods instead of the
deprecated assert method

 . failure in TimestampTest (testSetTimestamp) fixed. The failure is
because testSetTimestamp was inserting a timestamp with hour 7 but
checkTimeTest was expecting a timestamp with hour 8. AFAICS, there are
no issues wrt daylight savings time and timestamps being pushed in and
pulled out (but more explicit tests should be added in the future)

 . failure in TimeTest (testGetTime) fixed. Times to be inserted were
interpreted in the localtime zone but checking was done with the
assumption that the insertion was done in GMT.

 . formatting changes in a few of the source files (because I found
it convenient to have consistent formatting while working on them). The
formatting is consistent with the new format for java source files in
PostgreSQL.

Liam Stewart
2001-09-23 04:11:14 +00:00
Peter Eisentraut 364a7ebe26 Provide some initial support for building the ODBC driver for
an already installed iODBC or unixODBC driver manager.  In particular,
use the include files provided by the driver manager over our own,
and use the odbcinst library of the driver manager rather than gpps.c.

Migrate portability sections common to several files into psqlodbc.h.
2001-09-22 22:54:33 +00:00
Tom Lane c1c888a9de Code review for MD5 authorization patch. Clean up some breakage
(salts were always zero!?), add much missing documentation.
2001-09-21 20:31:49 +00:00
Hiroshi Inoue 39dc8ff64f 1) Avoid an overflow of connection string for Access(Microsoft Jet).
2) Change to retry lower version in case of "Unsupported frontend
procotol".
2001-09-21 07:51:52 +00:00
D'Arcy J.M. Cain ae64196acb Change the version. We are moving towards the next release.
Fixed a nasty bug that messed up negative money amounts.
2001-09-19 18:58:47 +00:00
Michael Meskes f0212ced68 - Synced preproc.y with gram.y.
- Synced pgc.l with scan.l.
- Synced keyword.c.
- Include the remaining patches by Christof Petig <christof.petig@wtal.de>.
2001-09-19 14:09:32 +00:00
Tom Lane a839258db5 Fix bogus failure-return value from lo_create, per report from Gavin
Sherry.  Also clean up leakage of open files and LOs in failure exits
from lo_import and lo_export.
2001-09-17 20:05:47 +00:00
Bruce Momjian 4f63a0e101 Attached is a patch that fixes ResultSetMetaData.isNullable() in
the JDBC driver.

This method is currently unimplemented and always returns
ResultSetMetaData.columnNullable. This is obviously incorrect
when a column is defined with NOT NULL or PRIMARY KEY. And we
have to think of check constraints, views, functions etc.

The patch simply changes the return value to
ResultSetMetaData.columnNullableUnknown. This is until someone
comes up with a real implementation of course.

On Fri, 14 Sep 2001 17:53:50 +0200, Tomisaw Kity?ski wrote:
>Hello there,
>
>could someone tell me, please, do I have any chance to get
>proper implementation of above method in JDBC (1.1+) soon?
>
>Current "return 1" works fine on most tables, however it seems
>to be a little bit incorrect with some of them ;)

Ren? Pijlman
2001-09-17 15:56:11 +00:00
Bruce Momjian 6e63468f3a I'm attaching a patch which fixes the corruption in strings caused
by escape processing in the SQL statement. I've tested this for a
while now and it appears to work well. Previously string data
with {d was getting corrupt as the {d was being stripped regardless
of whether it was an escape code or not.

I also added checking for time and timestamp escape processing strings
as per 11.3 in the specification. The patch is against the latest
CVS.

Thomas O'Dowd
2001-09-17 15:54:50 +00:00
Tom Lane ec7ddc1586 Use portable putenv(), not unportable setenv(). 2001-09-17 00:42:42 +00:00
Bruce Momjian c1fbf06654 > Here's a revised patch. Changes:
>
> 1. Now outputs '\\' instead of '\134' when using encode(bytea, 'escape')
> Note that I ended up leaving \0 as \000 so that there are no ambiguities
> when decoding something like, for example, \0123.
>
> 2. Fixed bug in byteain which allowed input values which were not valid
> octals (e.g. \789), to be parsed as if they were octals.
>
> Joe
>

Here's rev 2 of the bytea string support patch. Changes:

1. Added missing declaration for MatchBytea function
2. Added PQescapeBytea to fe-exec.c
3. Applies cleanly on cvs tip from this afternoon

I'm hoping that someone can review/approve/apply this before beta starts, so
I guess I'd vote (not that it counts for much) to delay beta a few days :-)

Joe Conway
2001-09-14 17:46:40 +00:00
Bruce Momjian e8d5b8d290 Allow '1' in jdbc2 boolean test. 2001-09-14 17:40:41 +00:00
Hiroshi Inoue 058841301c Change an *if condition*.
Hiroshi Inoue
2001-09-14 06:46:45 +00:00
Hiroshi Inoue 70b0831387 1) Improve the implementation of *Disallow Premature* for
older versions of servers.
2) Implement SQLProcedures.

Hiroshi Inoue
2001-09-14 06:30:37 +00:00
Hiroshi Inoue 5e14c9397d Fix a coversation error with pre 6.4 versions.
Hiroshi Inoue
2001-09-14 01:50:33 +00:00
Bruce Momjian 436d4aef07 Add missing paren to ODBC compiles. 2001-09-13 22:39:29 +00:00
Bruce Momjian 698a5d50c5 Didn't want that jdbc patch in there yet. 2001-09-13 17:01:31 +00:00
Bruce Momjian 54549d8dc4 > I found a problem with PQescapeString (I think). Since it escapes
> null bytes to be literally '\0', the following can happen:
> 1. User inputs string value as "<null byte>##" where ## are digits in the
> range of 0 to 7.
> 2. PQescapeString converts this to "\0##"
> 3. Escaped string is used in a context that causes "\0##" to be evaluated as
> an octal escape sequence.

I agree that this is a problem, though it is not possible to do
anything harmful with it.  In addition, it only occurs if there are
any NUL characters in its input, which is very unlikely if you are
using C strings.

The patch below addresses the issue by removing escaping of \0
characters entirely.

> If the goal is to "safely" encode null bytes, and preserve the rest of the
> string as it was entered, I think the null bytes should be escaped as \\000
> (note that if you simply use \000 the same string truncation problem
> occurs).

We can't do that, this would require 4n + 1 bytes of storage for the
result, breaking the interface.

Florian Weimer
2001-09-13 17:00:34 +00:00
Hiroshi Inoue 9f990a73c1 1) Not export ODBC 3.0 functions.
2) (Maybe) fix a bug reported by Mika Muntila.
2001-09-13 00:27:11 +00:00
Peter Eisentraut 9b35cce9ee Link ODBC driver with -lnsl and -lsocket, for Solaris.
reported by Bob Deblier (bob@virtualunlimited.com)
2001-09-11 23:27:10 +00:00
Hiroshi Inoue 0521051b0b Fix some multibyte related bugs.
Psqlodbc is 7.01.0007 now.

Hiroshi Inoue
2001-09-11 06:39:20 +00:00
Bruce Momjian 3ef5bebb72 Attached is a patch that fixes DatabaseMetaDataTest in the JDBC
driver's test suite. With previous patches applied, this reduces
the number of failures of the test suite from 6 to 4. The patch
fixes the test case itself, rather than the driver.

Details:

1) The driver correctly provided DatabaseMetaData about the sort
order of NULLs. This was confirmed by Peter Eisentraut on
pgsql-hackers. I fixed the test to accept/require the current
behaviour, and made it dependent on the backend version. See
nullsAreSortedAtStart(), nullsAreSortedAtEnd(),
nullsAreSortedHigh() and nullsAreSortedLow().

2) DatabaseMetaData.supportsOrderByUnrelated() correctly
returned true (an ORDER BY clause can contain columns that are
not in the SELECT clause), but the test case required false.
Fixed that.

3) Replaced deprecated assert() of junit.framework.TestCase by
assertEquals(), assertTrue() and assertNotNull(). This is
because assert will be a new keyword in Java 1.4.

4) Replaced assert(message,false) by the more elegant
fail(message).

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-10 15:07:58 +00:00
Bruce Momjian ec0ad67403 Attached is a patch to add bytea support to JDBC.
This patch does the following:

- Adds binary datatype support (bytea)
- Changes getXXXStream()/setXXXStream() methods to be spec compliant
- Adds ability to revert to old behavior

Details:

Adds support for the binary type bytea.  The ResultSet.getBytes() and
PreparedStatement.setBytes() methods now work against columns of bytea
type.  This is a change in behavior from the previous code which assumed
the column type was OID and thus a LargeObject.  The new behavior is
more complient with the JDBC spec as BLOB/CLOB are to be used for
LargeObjects and the getBytes()/setBytes() methods are for the databases
binary datatype (which is bytea in postgres).

Changes the behavior of the getBinaryStream(), getAsciiStream(),
getCharacterStream(), getUnicodeStream() and their setXXXStream()
counterparts.  These methos now work against either the bytea type
(BinaryStream) or the text types (AsciiStream, CharacterStream,
UnicodeStream).  The previous behavior was that these all assumed the
underlying column was of type OID and thus a LargeObject.  The
spec/javadoc for these methods indicate that they are for LONGVARCHAR
and LONGVARBINARY datatypes, which are distinct from the BLOB/CLOB
datatypes.  Given that the bytea and text types support upto 1G, they
are the LONGVARBINARY and LONGVARCHAR datatypes in postgres.

Added support for turning off the above new functionality.  Given that
the changes above are not backwardly compatible (however they are more
spec complient), I added the ability to revert back to the old behavior.
  The Connection now takes an optional parameter named 'compatible'.  If
the value of '7.1' is passed, the driver reverts to the 7.1 behavior.
If the parameter is not passed or the value '7.2' is passed the behavior
is the new behavior.  The mechanism put in place can be used in the
future when/if similar needs arise to change behavior.  This is
patterned after how Oracle does this (i.e. Oracle has a 'compatible'
parameter that behaves in a similar manner).

Misc fixes.  Cleaned up a few things I encountered along the way.


Note that in testing the patch I needed to ignore whitespace differences
in order to get it to apply cleanly (i.e. patch -l -i byteapatch.diff).
Also this patch introduces a new file
(src/interfaces/jdbc/org/postgresql/util/PGbytea.java).

Barry Lind
2001-09-10 15:07:05 +00:00
Bruce Momjian 6b50f9af33 On Fri, 07 Sep 2001 01:34:46 -0400, Tom Lane wrote:
>there is still an unpatched reference to pg_description in
>getColumns(), in both jdbc1 and jdbc2.

This was introduced by Jeroen's patch (see
http://fts.postgresql.org/db/mw/msg.html?mid=1032468). Attached
is a patch that returns getColumns() to using "select
obj_description()" instead of direct access to pg_description,
as per the request by Tom.

I've incorporated Jeroen's fix to left outer join with
pg_attrdef instead of inner join, so getColumns() also returns
columns without a default value.

I have, however, not included Jeroen's attempt to combine
multiple queries into one huge multi-join query for better
performance, because:
1) I don't know how to do that using obj_description() instead
of direct access to pg_description
2) I don't think a performance improvement (if any) in this
method is very important

Because of the outer join, getColumns() will only work with a
backend >= 7.1. Since the conditional coding for 7.1/7.2 and
jdbc1/jdbc2 is already giving me headaches I didn't pursue a
pre-7.1 solution.

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-10 14:55:08 +00:00
Bruce Momjian c69bb04acc Attached is a patch that fixes
ConnectionTest.testTransactionIsolation() in the JDBC driver's
test suite. This reduces the number of failures of the test
suite from 7 to 6. The patch fixes the test case itself, rather
than the driver.

In addition to the change described in my posting below, I fixed
the part of the test with autocommit enabled. The author of the
test assumed that setting the transaction isolation level would
have no effect, but in fact it does. Perhaps the test case
worked with pre-7.1 behaviour, when the JDBC driver set the
isolation level in every transaction, instead of using "set
session characteristics". Anyway, now it works with a backend
built from current CVS and the behaviour is JDBC compliant.

I also extended the test case by changing the isolation level
before beginning a transaction and verifying it inside the
transaction.

Regards,
Ren? Pijlman
2001-09-10 14:54:22 +00:00
Bruce Momjian 9e46767161 The attached patch should be sufficient to fix libpgtcl. It requires
PostgreSQL to support unicode-conversion, but retains binary
compatibility among Tcl versions.

However, it neither checks at compile time not at runtime, if support
for unicode-conversion does really exist and it doesn't prevent the
user from changing the client encoding after initialization. I think
there should be warnings about this somewhere in the documentation.

Reinhard Max
2001-09-10 14:49:12 +00:00
Hiroshi Inoue 0ee85f853f Change dialog windows. 2001-09-10 10:13:30 +00:00
Hiroshi Inoue 9abd055405 1) Fix SQLForeignKeys() in multibyte mode.
2) Fix a bug with NUMERIC scale in case of Parse
  statement option.
3) Remove a no longer needed loop in CC_send_query().

Hiroshi Inoue
2001-09-10 08:53:27 +00:00
Bruce Momjian da1696b5c1 Remove INV_ARCHIVE mention in python readme. 2001-09-10 04:21:14 +00:00
Bruce Momjian 39d1169939 Remove INV_ARCHIVE mention in perl. 2001-09-10 04:19:19 +00:00
Hiroshi Inoue ec6c4d8c82 Improve declare/fetch mode a little.
Add a new DSN option for PREPARE hadling.

Hiroshi Inoue
2001-09-08 16:20:16 +00:00
Bruce Momjian 468b9d8202 Move updateCommon() into Win32 block because it is only used there. 2001-09-08 02:48:53 +00:00
Hiroshi Inoue 4ad1b5b766 Resolve compile errors on unix.
Rename psqlodbc.def -> psqlodbc_win32.def.
Improve internal *declare cursor* handling
a little.

Hiroshi Inoue
2001-09-08 02:28:41 +00:00
Bruce Momjian 6b9f94022c Move TESTSUITE file to test/README. 2001-09-07 23:34:16 +00:00
Tom Lane 09e99a1082 Change addlit() to not assume its input is null-terminated, so that we
don't have more bugs like the quote-quote-quote-quote one.  Propagate
fix into ecpg lexer, too.
2001-09-07 23:17:14 +00:00
Bruce Momjian b6385efb79 Attached is a patch that fixes 2 test cases of the JDBC test
suite. This reduces the number of failures from 9 to 7.

Both ConnectionTest and JBuilderTest did not create their own
tables, which caused these test cases to fail with "relation ...
does not exist". It appears these test cases relied on tables
created by the example code elsewhere in the source tree. I've
added the necessary "create table" and "drop table" statements
to the test cases, using the column definitions from the example
code.

While working on that I modified the helper method createTable
in JDBC2Tests.java to take a table parameter, rather than using
table names passed via the properties in build.xml. I'm not sure
what that was good for, and in fact, except for the default
table name "jdbctest", this functionality wasn't used at all.

Ren? Pijlman
2001-09-07 22:17:48 +00:00
Bruce Momjian 7066253ab5 Read transactions don't work on 7.0.x db's 2nd patch
Here is a revised patch with Barry's suggestions implemented

Dave Cramer
2001-09-07 22:17:02 +00:00
Bruce Momjian 6ea41dcc7b Patch for jdbc2 ResultSet.java. Looks like performance improvement.
Joseph Shraibman
2001-09-07 22:15:55 +00:00
Bruce Momjian 1834987fb6 I've attached the fixed version of the patch below. After the
discussion on pgsql-hackers (especially the frightening memory dump in
<12273.999562219@sss.pgh.pa.us>), we decided that it is best not to
use identifiers from an untrusted source at all.  Therefore, all
claims of the suitability of PQescapeString() for identifiers have
been removed.

Florian Weimer
2001-09-07 22:02:32 +00:00
Bruce Momjian 68e190cfa4 >has anyone ever successfully done copy to/from stdout with the
>tcl-extension for postgreSQL.
>I'm currently using 7.0 and always getting a seg fault when I try to
>read from the database connection after issueing a "COPY table TO
>stdout;" (I'm using the connection handle, *not* the result handle).
>Maybe this is fixed in a later release.
>The README file in src/interfaces/libpgtcl tells me, that this should
>work, but unforunately it doesn't.

Yes, it seems broken. It is a bug in libpgtcl.  Are you running Tcl >= 8.3.2?
That's when the Tcl team changed the data structure for channel
callbacks.  The change itself was designed to be backward compatible, but I
suspect a related change made the code more sensitive to errors in the
structure (NULL pointers where functions are required).  Either that, or
nobody has tried to use libpgtcl with COPY in a long time.

First, I have to say I can't think of a good reason to use PostgreSQL's
COPY command from a Tcl application. I think it should only be used with
psql for importing data from another source into PostgreSQL, or for
exporting PostgreSQL data into another database (but why would anyone do
that?) If it was me, I would stick with SELECT and INSERT and be "SQL
Compliant".

OK, editorial is over. Try applying the patch below to fix
      src/interfaces/libpgtcl/pgtclId.c
and let us know if it works. I did little testing on it, but my test did
segfault before and ran fine (copy in and copy out) after the patch.  This
is for PostgreSQL-7.1.2 - since you are running older 7.0, I don't know if
this will work, but I suspect it will.

PS It's the absence of PgWatchProc which kills it. I didn't upgrade it
to the "V2" channel type structure, so it should be compatible with older
Tcl's. But aside from gets and puts, I doubt any other file operations
would work on the handle during a copy.

ljb
2001-09-07 21:55:00 +00:00
Bruce Momjian a926c7058b Add Java testsuite info. 2001-09-07 21:45:42 +00:00
Bruce Momjian a7621c92ae Update SCM_CREDS for Net/Free/BSD-OS. Add configure checks. 2001-09-07 19:52:54 +00:00
Hiroshi Inoue 377d131b6c 1) Most driver options could be set per DSN.
2) Keep FE/BE protocol more precisely.
3) Improve procedure calls.
4) A trial to avoid PREMATURE execution(#ifdef'd now).

Hiroshi Inoue
2001-09-07 06:02:24 +00:00
Bruce Momjian 0059c4216c >Well, if it is that easy, I can do it. Patch attached and applied.
>
>> On Mon, 3 Sep 2001 22:01:17 -0500, you wrote:
>>     public boolean isWritable(int column) throws SQLException
>>     {
>>         return !isReadOnly(column);
>>     }

Actually, I think this change has a consequence for this method
in the same class:

    public boolean isDefinitelyWritable(int column)
        throws SQLException
    {
        return isWritable(column);
    }

This is from the JDBC spec
(http://java.sun.com/j2se/1.3/docs/api/java/sql/ResultSetMetaData.html):

  isReadOnly() - Indicates whether the designated column is
definitely not writable.

  isWritable() - Indicates whether it is possible for a write on
the designated column to succeed.

  isDefinitelyWritable() - Indicates whether a write on the
designated column will definitely succeed.

At this time we don't really implement the fine semantics of
these methods. I would suggest the following defaults:

  isReadOnly()             false
  isWritable()             true
  isDefinitelyWritable()   false

And that would mean that your patch is correct, but
isDefinitelyWritable() would need to be patched accordingly:

    public boolean isDefinitelyWritable(int column)
        throws SQLException
    {
        return false;
    }

Again, both in jdbc1 and jdbc2.

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-06 20:43:39 +00:00
Bruce Momjian afa178e7e2 On Mon, 3 Sep 2001 22:01:17 -0500, you wrote:
>public boolean isWritable(int column) throws SQLException
>{
>        if (isReadOnly(column))
>                return true;
>        else
>                return false;
>}

The author probably intended:

    public boolean isWritable(int column) throws SQLException
    {
        return !isReadOnly(column);
    }

And if he would have coded it this way he wouldn't have made
this mistake :-)

>hence, isWritable() will always return false. this is something
>of a problem :)

Why exactly? In a way, true is just as incorrect as false, and
perhaps it should throw "not implemented". But I guess that
would be too non-backwardly-compatible.

>let me know if i can provide further information.

Will you submit a patch?

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-06 18:26:37 +00:00
Bruce Momjian 343e38a938 > The win32.mak and libpgtcl.def files had been lost (patch doesn't handle
> new files). I'm attaching those two files below.
>
> Regards
> Mikhail Terekhov
2001-09-06 15:20:19 +00:00
Bruce Momjian f57477e651 > Patch applied. Thanks.
Thanks. However, I seem to have left a single debug statement in there :-(

Here's a patch to remove it.

Vianen, Jeroen van
2001-09-06 12:53:15 +00:00
Tatsuo Ishii f25ed23c57 Fix Karel's patch. Suggested by Eiji Tokuya 2001-09-06 05:01:38 +00:00
Tatsuo Ishii 227767112c Commit Karel's patch.
-------------------------------------------------------------------
Subject: Re: [PATCHES] encoding names
From: Karel Zak <zakkr@zf.jcu.cz>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-patches <pgsql-patches@postgresql.org>
Date: Fri, 31 Aug 2001 17:24:38 +0200

On Thu, Aug 30, 2001 at 01:30:40AM +0200, Peter Eisentraut wrote:
> > 		- convert encoding 'name' to 'id'
>
> I thought we decided not to add functions returning "new" names until we
> know exactly what the new names should be, and pending schema

 Ok, the patch not to add functions.

> better
>
>     ...(): encoding name too long

 Fixed.

 I found new bug in command/variable.c in parse_client_encoding(), nobody
probably never see this error:

if (pg_set_client_encoding(encoding))
{
	elog(ERROR, "Conversion between %s and %s is not supported",
                     value, GetDatabaseEncodingName());
}

because pg_set_client_encoding() returns -1 for error and 0 as true.
It's fixed too.

 IMHO it can be apply.

		Karel
PS:

    * following files are renamed:

src/utils/mb/Unicode/KOI8_to_utf8.map  -->
        src/utils/mb/Unicode/koi8r_to_utf8.map

src/utils/mb/Unicode/WIN_to_utf8.map  -->
        src/utils/mb/Unicode/win1251_to_utf8.map

src/utils/mb/Unicode/utf8_to_KOI8.map -->
        src/utils/mb/Unicode/utf8_to_koi8r.map

src/utils/mb/Unicode/utf8_to_WIN.map -->
        src/utils/mb/Unicode/utf8_to_win1251.map

   * new file:

src/utils/mb/encname.c

   * removed file:

src/utils/mb/common.c

--
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
2001-09-06 04:57:30 +00:00
Bruce Momjian 50aa3020ac Add missing files. 2001-09-06 03:58:59 +00:00