Go to file
Bruce Momjian f478692552 The attached file: SerializePatch2.tgz, contains a patch for
org.postgresql.util.Serialize and org.postgresql.jdbc2.PreparedStatement
that  fixes the ability to "serialize" a simple java class into a
postgres table.

The current cvs seems completely broken in this support, so the patch
puts it  into working condition, granted that there are many limitations
with  serializing java classes into Postgres.

The code to do serialize appears to have been in the driver since
Postgres  6.4, according to some comments in the source.  My code is not
adding any  totally new ability to the driver, rather just fixing what
is there so that  it actually is usable.  I do not think that it should
affect any existing  functions of the driver that people regularly
depend on.

The code is activated if you use jdbc2.PreparedStatement and try to
setObject  some java class type that is unrecognized, like not String or
not some other  primitive type.  This will cause a sequence of function
calls that results in  an instance of Serialize being instantiated for
the class type passed.  The  Serialize constructor will query pg_class
to see if it can find an existing  table that matches the name of the
java class. If found, it will continue and  try to use the table to
store the object, otherwise an SQL exception is  thrown and no harm is
done.  Serialize.create() has to be used to setup the  table for a java
class before anything can really happen with this code other  than an
SQLException (unless by some freak chance a table exists that it  thinks
it can use).

I saw a difference in Serialize.java between 7.1.3 and 7.2devel that I
didn't  notice before, so I had to redo my changes from the 7.2devel
version (why I  had to resend this patch now).  I was missing the
fixString stuff, which is  nice and is imporant to ensure the inserts
will not fail due to embedded  single quote or unescaped backslashes. I
changed that fixString function in  Serialize just a little since there
is no need to muddle with escaping  newlines: only escaping single quote
and literal backslashes is needed.  Postgres appears to insert newlines
within strings without trouble.
2001-08-26 00:54:42 +00:00
ChangeLogs not sure about this one ... but should have changelog in both versions ... 2001-05-05 20:24:56 +00:00
config Do not pre-expand localedir as substituted in the makefile, so that 'make 2001-08-06 15:46:44 +00:00
contrib Makefile forgot to install README.btree_gist. 2001-08-23 16:55:53 +00:00
doc Replace implementation of pg_log as a relation accessed through the 2001-08-25 18:52:43 +00:00
src The attached file: SerializePatch2.tgz, contains a patch for 2001-08-26 00:54:42 +00:00
COPYRIGHT Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group. 2001-01-24 19:43:33 +00:00
GNUmakefile.in Rearrange distribution split as discussed on -hackers. 2001-04-08 17:28:10 +00:00
HISTORY Just a test. 2001-08-15 19:41:08 +00:00
INSTALL Revert wrong SCO OpenServer report, update comments and improve formatting 2001-04-06 15:52:41 +00:00
Makefile Restructure the key include files per recent pghackers discussion: there 2001-02-10 02:31:31 +00:00
README Stamp CVS as 7.2. Update all interface version numbers. This is the 2001-05-11 01:46:33 +00:00
aclocal.m4 Ok, I've split todays commit into three, the first two already done had some 2001-03-05 09:40:02 +00:00
configure Rename config.h to pg_config.h and os.h to pg_config_os.h, fix a number of 2001-08-24 14:07:50 +00:00
configure.in Rename config.h to pg_config.h and os.h to pg_config_os.h, fix a number of 2001-08-24 14:07:50 +00:00
register.txt Stamp CVS as 7.2. Update all interface version numbers. This is the 2001-05-11 01:46:33 +00:00

README

PostgreSQL Data Base Management System (formerly known as Postgres, then
as Postgres95).
  
This directory contains the development version of 7.2 of the
PostgreSQL database server.  The server is not 100% ANSI SQL compliant,
but it gets closer with every release.  After you unzip and untar the
distribution file, look at file INSTALL for the installation notes and
file HISTORY for the changes.

The latest version of this software may be obtained at
ftp://ftp.postgresql.org/pub/.  For more information look at our WWW
home page located at http://www.postgreSQL.org/.

PostgreSQL is not public domain software.  It is copyrighted by the
University of California but may be used according to the licensing
terms of the the copyright below:

------------------------------------------------------------------------

POSTGRES95 Data Base Management System (formerly known as Postgres, then
as Postgres95).

Copyright (c) 1994-7 Regents of the University of California

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this
paragraph and the following two paragraphs appear in all copies.

IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.