pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedwrong documentation and others .....
15+ messages / 5 participants
[nested] [flat]
* wrong documentation and others .....
@ 2000-10-05 10:59 Gabriel Lopez <gabilm@dif.um.es>
0 siblings, 2 replies; 15+ messages in thread
From: Gabriel Lopez @ 2000-10-05 10:59 UTC (permalink / raw)
To: pgsql-interfaces
Hi all.
I have several days working with LargeObject and postgres 7.0.2 and
I have found many problems. In the first time the postgresql doc is
wrong, in chapter 58 of PosgreSQL tutorial (JDBC Interfaces) it repot
who to work with Large Object and give code that is wrong:
File file = new File("myimage.gif");
FileInputStream fis = new FileInputStream(file);
PreparedStatement ps = conn.prepareStatement("insert into images
values (?,?)");
ps.setString(1,file.getName());
ps.setBinaryStream(2,fis,file.length());
ps.executeUpdate();
ps.close();
fis.close();
PreparedStatement ps = con.prepareStatement("select oid from
images where name=?");
ps.setString(1,"myimage.gif");
ResultSet rs = ps.executeQuery();
if(rs!=null) {
while(rs.next()) {
InputStream is = rs.getBinaryInputStream(1);
// use the stream in some way here
is.close();
}
rs.close();
}
ps.close();
InputStream ARE NOT SUPPORTED in JDBC implementation ¡¿?¡ and
"getBinaryInputStream()" really is "getBinaryStream()". I think that it
is very serious. The other method (that I know) is using LargeObjectAPI,
but this fail every 9 times of PreparedStatement of setObject() sentence
¡¡¡ and when use LargeObjectManager as in source examples. (I send other
messages to list)
Has PostgreSQL any way to work WELL with LargeObject.?
Please reply me.
Cheers, Gabi.
--
Gabriel López Millán
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-10-05 11:15 Troels Jegbjaerg Moerch <tjm2@mail.ikasths.dk>
parent: Gabriel Lopez <gabilm@dif.um.es>
1 sibling, 1 reply; 15+ messages in thread
From: tjm2@mail.ikasths.dk @ 2000-10-05 11:15 UTC (permalink / raw)
To: pgsql-interfaces
Hi try this:
File file = new File("myimage.gif");
FileInputStream fis = new FileInputStream(file);
byte[] theByteArray = new byte[fis.available()];
fis.read(theByteArray);
PreparedStatement ps = con.prepareStatement("insert insert into images values (?,?)");
ps.setString(1,file.getName());
ps.setBytes(2, theByteArray);
ps.execute();
con.commit();
ps.close();
fis.close();
TJM
----- Original Message -----
From: Gabriel Lopez
To: psql
Sent: Thursday, October 05, 2000 12:59 PM
Subject: [INTERFACES] wrong documentation and others .....
Hi all.
I have several days working with LargeObject and postgres 7.0.2 and I have found many problems. In the first time the postgresql doc is wrong, in chapter 58 of PosgreSQL tutorial (JDBC Interfaces) it repot who to work with Large Object and give code that is wrong:
File file = new File("myimage.gif");
FileInputStream fis = new FileInputStream(file);
PreparedStatement ps = conn.prepareStatement("insert into images values (?,?)");
ps.setString(1,file.getName());
ps.setBinaryStream(2,fis,file.length());
ps.executeUpdate();
ps.close();
fis.close();
PreparedStatement ps = con.prepareStatement("select oid from images where name=?");
ps.setString(1,"myimage.gif");
ResultSet rs = ps.executeQuery();
if(rs!=null) {
while(rs.next()) {
InputStream is = rs.getBinaryInputStream(1);
// use the stream in some way here
is.close();
}
rs.close();
}
ps.close();
InputStream ARE NOT SUPPORTED in JDBC implementation ¡¿?¡ and "getBinaryInputStream()" really is "getBinaryStream()". I think that it is very serious. The other method (that I know) is using LargeObjectAPI, but this fail every 9 times of PreparedStatement of setObject() sentence ¡¡¡ and when use LargeObjectManager as in source examples. (I send other messages to list)
Has PostgreSQL any way to work WELL with LargeObject.?
Please reply me.
Cheers, Gabi.
--
Gabriel López Millán
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-10-05 11:36 Gabriel Lopez <gabilm@dif.um.es>
parent: Troels Jegbjaerg Moerch <tjm2@mail.ikasths.dk>
0 siblings, 1 reply; 15+ messages in thread
From: Gabriel Lopez @ 2000-10-05 11:36 UTC (permalink / raw)
To: ; +Cc: pgsql-interfaces
Troels Jegbjaerg Moerch escribió:
> Hi try this: File file = new File("myimage.gif");
> FileInputStream fis = new FileInputStream(file);
> byte[] theByteArray = new byte[fis.available()];
> fis.read(theByteArray);
>
> PreparedStatement ps = con.prepareStatement("insert insert into
> images values (?,?)"); ps.setString(1,file.getName());
> ps.setBytes(2, theByteArray);
> ps.execute();
> con.commit();
> ps.close();
> fis.close();
> TJM
Yes, it work fine, but each 9 times it fail:
FATAL 1: my bits moved right off the end of the world!
Recreate index pg_attribute_relid_attnam_index.
Anybody known why?
Thanks
--
Gabriel López Millán
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-10-06 11:51 Gabriel Lopez <gabilm@dif.um.es>
parent: Gabriel Lopez <gabilm@dif.um.es>
0 siblings, 0 replies; 15+ messages in thread
From: Gabriel Lopez @ 2000-10-06 11:51 UTC (permalink / raw)
To: pgsql-interfaces
Has anybody try this?
I don't know why this error appear.
Please, reply me.
Thanks, Gabi.
Gabriel Lopez escribió:
> Troels Jegbjaerg Moerch escribió:
>
> > Hi try this: File file = new File("myimage.gif");
> > FileInputStream fis = new FileInputStream(file);
> > byte[] theByteArray = new byte[fis.available()];
> > fis.read(theByteArray);
> >
> > PreparedStatement ps = con.prepareStatement("insert insert into
> > images values (?,?)"); ps.setString(1,file.getName());
> > ps.setBytes(2, theByteArray);
> > ps.execute();
> > con.commit();
> > ps.close();
> > fis.close();
> > TJM
>
> Yes, it work fine, but each 9 times it fail:
>
> FATAL 1: my bits moved right off the end of the world!
> Recreate index pg_attribute_relid_attnam_index.
>
> Anybody known why?
>
> Thanks
>
> --
> Gabriel López Millán
> Facultad de Informática -Universidad de Murcia
> 30001 Murcia - España (Spain)
> Telf: +34-968-364644 E-mail: gabilm@dif.um.es
--
Gabriel López Millán
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-10-06 22:58 David Huttleston Jr <dhjr@hddesign.com>
parent: Gabriel Lopez <gabilm@dif.um.es>
1 sibling, 1 reply; 15+ messages in thread
From: David Huttleston Jr @ 2000-10-06 22:58 UTC (permalink / raw)
To: pgsql-interfaces
Hi Gabriel,
We have been using the postgresql JDBC to serialize classes and have
had no problems since we figured out that the doc's are wrong. I had
to find answers in the source code.
I've attached a class called Shelf which serializes any java object to a
table. Within the code is the schema of a table called tbl_objectshelf which
is suitable as a "shelf". I hope this saves you some time.
Have fun,
Dave
On Thu, 05 Oct 2000 12:59:53 +0200, you wrote:
>
>
> Hi all.
>
> I have several days working with LargeObject and postgres 7.0.2 and
> I have found many problems. In the first time the postgresql doc is
> wrong, in chapter 58 of PosgreSQL tutorial (JDBC Interfaces) it repot
> who to work with Large Object and give code that is wrong:
>
> File file = new File("myimage.gif");
> FileInputStream fis = new FileInputStream(file);
> PreparedStatement ps = conn.prepareStatement("insert into images
> values (?,?)");
> ps.setString(1,file.getName());
> ps.setBinaryStream(2,fis,file.length());
> ps.executeUpdate();
> ps.close();
> fis.close();
>
> PreparedStatement ps = con.prepareStatement("select oid from
> images where name=?");
> ps.setString(1,"myimage.gif");
> ResultSet rs = ps.executeQuery();
> if(rs!=null) {
> while(rs.next()) {
> InputStream is = rs.getBinaryInputStream(1);
> // use the stream in some way here
> is.close();
> }
> rs.close();
> }
> ps.close();
>
>
> InputStream ARE NOT SUPPORTED in JDBC implementation ¡¿?¡ and
> "getBinaryInputStream()" really is "getBinaryStream()". I think that it
> is very serious. The other method (that I know) is using LargeObjectAPI,
> but this fail every 9 times of PreparedStatement of setObject() sentence
> ¡¡¡ and when use LargeObjectManager as in source examples. (I send other
> messages to list)
>
>
> Has PostgreSQL any way to work WELL with LargeObject.?
>
> Please reply me.
>
> Cheers, Gabi.
>
>
> --
> Gabriel López Millán
> Facultad de Informática -Universidad de Murcia
> 30001 Murcia - España (Spain)
> Telf: +34-968-364644 E-mail: gabilm@dif.um.es
>
>
>
>
Attachments:
Shelf.java (application/octet-stream, 3.0K) download
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-10-09 09:01 Gabriel Lopez <gabilm@dif.um.es>
parent: David Huttleston Jr <dhjr@hddesign.com>
0 siblings, 0 replies; 15+ messages in thread
From: Gabriel Lopez @ 2000-10-09 09:01 UTC (permalink / raw)
To: pgsql-interfaces
David Huttleston Jr escribió:
> Hi Gabriel,
> We have been using the postgresql JDBC to serialize classes and have
> had no problems since we figured out that the doc's are wrong. I had
> to find answers in the source code.
> I've attached a class called Shelf which serializes any java object to a
> table. Within the code is the schema of a table called tbl_objectshelf which
> is suitable as a "shelf". I hope this saves you some time.
>
> Have fun,
> Dave
>
Yes, your code work fine, as my code, in Linux. I don't know if in any of
my older messages say that I'm working with solaris, if no, sorry:
SunOS maquina 5.7 Generic_106541-02 sun4u sparc
SUNW,Ultra-5_10
Your code also fail in solaris when your run the program several times.
--
Gabriel López Millán
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-10-12 21:36 David Huttleston Jr <dhjr@hddesign.com>
0 siblings, 1 reply; 15+ messages in thread
From: David Huttleston Jr @ 2000-10-12 21:36 UTC (permalink / raw)
To: Gabriel Lopez <gabilm@dif.um.es>; +Cc: pgsql-interfaces
Hola Gabi,
I have an idea. I've read in some Java Usenet groups that class
files are not as Write-Once-Read-Everywhere as Sun would like us
to believe. If you are using one of the Jar files provided by Peter Mount
it might be a good idea to compile the JDBC class from source.
Compiling on your systems could help in two ways. The compiler
could spot the problem e.g. a name collison. Also, the solaris javac might
produce class files which do not cause the error in your solaris JVM.
Another thought, is there any chance you have an old version of
the postgresql JDBC drivers in the classpath of your solaris system?
I had an annoying bug once myself when an old version of a library
was in my classpath before the proper version, so the old-buggy
version was the library being used.
Hasta Luego,
Dave
On Wed, 11 Oct 2000 09:52:28 +0200, you wrote:
> David Huttleston Jr escribió:
>
> > Hola Gaberiel,
> > I have a some questions to try to help track down your problem.
> >
>
> Hola David. Thanks to reponse. I will try to related my problem in detail.
>
> >
> > 1) Which program of mine did you run? Was is the shelf I sent first, or the
> > better cleaned up version I posted as 'An Example of Large Objects and JDBC'?
>
> The second. The only change is to add a "for" sentence.
>
> for (int i = 0; i < 50; i++) {
> // build an sample object to save on the shelf
> ArrayList stuff = new ArrayList();
> ........
> Integer key = new Integer(i);
> ...........
> }
>
> Even the original code, when is running serveral times also fail.
>
> > 2) What version of the postgresql JDBC driver are you using?
>
> I'm using postgresql-7.0.2 with the original jdbc drivers in the
> distribution. This have installed the jdbc6.3.tar.gz patch. I'm not installed ANY patch
> or others drivers.
>
> >
> > 3) What version of JVM 1.2?
>
> As I say in the previous message in Linux the code work fine, but it fail
> in Solaris. I'm using
> SunOS myhost 5.7 Generic_106541-02 sun4u sparc SUNW,Ultra-5_10
> And yes, I'm using jvm1.2
>
> >
> > 4) Are you using a JIT?
>
> NO
>
> >
> > 5) How are you running the program? (Stand-alone, as a Servlet, ...)
>
> Your code in running stand-alone.
>
> > 6) When the program fails, can you print a stacktrace?
>
> Whit the above interation:
>
> bash-2.03# java TestShelf
> The second item within stuff: my 2nd thing
> The second item within stuff: my 2nd thing
> The second item within stuff: my 2nd thing
> FATAL 1: my bits moved right off the end of the world!
> Recreate index pg_attribute_relid_attnam_index.
> FastPath call returned FATAL 1: my bits moved right off the end of the world!
> Recreate index pg_attribute_relid_attnam_index.
>
> at org.postgresql.fastpath.Fastpath.fastpath(Compiled Code)
> at org.postgresql.fastpath.Fastpath.fastpath(Compiled Code)
> at org.postgresql.fastpath.Fastpath.getInteger(Compiled Code)
> at org.postgresql.largeobject.LargeObjectManager.create(Compiled Code)
> at org.postgresql.jdbc2.PreparedStatement.setBytes(Compiled Code)
> at Shelf.putObject(Compiled Code)
> at TestShelf.main(Compiled Code)
>
> >
> >
> > Problems that happen after a few executions, in-my-experience, usually happen
> > when resources (like connections) are not being released correctly. Hopefully
> > we can track down why if we know your enviroment better.
> >
>
> I think that is not a problem of code. It seem that is a problem with solaris
>
> >
> > Adios,
> > David
> >
>
> Thanks for your time, Gabi.
>
> --
> Gabriel López Millán
> Facultad de Informática -Universidad de Murcia
> 30001 Murcia - España (Spain)
> Telf: +34-968-364644 E-mail: gabilm@dif.um.es
>
>
>
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-10-13 07:30 Gabriel Lopez <gabilm@dif.um.es>
parent: David Huttleston Jr <dhjr@hddesign.com>
0 siblings, 1 reply; 15+ messages in thread
From: Gabriel Lopez @ 2000-10-13 07:30 UTC (permalink / raw)
To: dhjr@hddesign.com; +Cc: pgsql-interfaces
Hola.
I will try this. It can be a solution. If this work I will notify to the list.
Thanks for your time, Gabi.
David Huttleston Jr escribió:
> Hola Gabi,
> I have an idea. I've read in some Java Usenet groups that class
> files are not as Write-Once-Read-Everywhere as Sun would like us
> to believe. If you are using one of the Jar files provided by Peter Mount
> it might be a good idea to compile the JDBC class from source.
> Compiling on your systems could help in two ways. The compiler
> could spot the problem e.g. a name collison. Also, the solaris javac might
> produce class files which do not cause the error in your solaris JVM.
> Another thought, is there any chance you have an old version of
> the postgresql JDBC drivers in the classpath of your solaris system?
> I had an annoying bug once myself when an old version of a library
> was in my classpath before the proper version, so the old-buggy
> version was the library being used.
> Hasta Luego,
> Dave
>
--
Gabriel López Millán
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-10-16 16:24 Gabriel Lopez <gabilm@dif.um.es>
parent: Gabriel Lopez <gabilm@dif.um.es>
0 siblings, 0 replies; 15+ messages in thread
From: Gabriel Lopez @ 2000-10-16 16:24 UTC (permalink / raw)
To: dhjr@hddesign.com; pgsql-interfaces
Hi again. Sorry to be late.
I have recompiled the jdbc drivers in Solaris and it fail again. I have see the
source code and I only can arrive to see the error in:
org/postgresql/fastpath/FasPath.java
in the method:
public Object fastpath(int fnid,boolean resulttype,FastpathArg[] args)
the fail is in the loop reading the result:
sometime a 'E' element is return after a 'Z'
Cheers, Gabi.
Gabriel Lopez escribió:
> Hola.
>
> I will try this. It can be a solution. If this work I will notify to the list.
>
> Thanks for your time, Gabi.
>
> David Huttleston Jr escribió:
>
> > Hola Gabi,
> > I have an idea. I've read in some Java Usenet groups that class
> > files are not as Write-Once-Read-Everywhere as Sun would like us
> > to believe. If you are using one of the Jar files provided by Peter Mount
> > it might be a good idea to compile the JDBC class from source.
> > Compiling on your systems could help in two ways. The compiler
> > could spot the problem e.g. a name collison. Also, the solaris javac might
> > produce class files which do not cause the error in your solaris JVM.
> > Another thought, is there any chance you have an old version of
> > the postgresql JDBC drivers in the classpath of your solaris system?
> > I had an annoying bug once myself when an old version of a library
> > was in my classpath before the proper version, so the old-buggy
> > version was the library being used.
> > Hasta Luego,
> > Dave
> >
>
> --
> Gabriel López Millán
> Facultad de Informática -Universidad de Murcia
> 30001 Murcia - España (Spain)
> Telf: +34-968-364644 E-mail: gabilm@dif.um.es
--
Gabriel López Millán
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-10-16 20:20 David Huttleston Jr <dhjr@hddesign.com>
0 siblings, 0 replies; 15+ messages in thread
From: David Huttleston Jr @ 2000-10-16 20:20 UTC (permalink / raw)
To: Gabriel Lopez <gabilm@dif.um.es>; +Cc: pgsql-interfaces
Peter Mount's JDBC driver translates the query results from the postgresql
process to Java via the JDBC standard. As I see it, the source of your problem
can be at several levels.
1) A bug in the program
2) A bug in the Solaris JVM
3) A problem with the JDBC driver
4) A problem with your postgresql config on the solaris
#1 seems unlikely since your program and mine work on linux but not on solaris
#2 seems unlikely since Solaris is the flagship for Sun's Java efforts
#3 is possible, but our programs _and_ JDBC work fine under linux
#4 is the only possibility we have not discussed.
The first way to test if the solaris configuration of postgresql is the problem
is to test a query using an interface which is _not_ JDBC. The simpliest, is
psql. Test the large-object support using lo_import and lo_export from within
psql. In the documentation, section IV (Interfaces)-- chapter 51 (Large Objects)
has a page called 'Built in registered functions'. This page shows an example of how
to 'manually' store and retrieve a large-object which can be typed into the psql
interface and tested.
If lo_import and lo_export work, but JDBC does _not_ work. We should get Peter
Mount's direct attention. I don't know if he's familiar with solaris, but might be
able to point you toward a solution based on your stack trace.
Buena Suerte,
Dave
On Mon, 16 Oct 2000 18:42:17 +0200, you wrote:
> David Huttleston Jr escribió:
>
> > Hey Gabi,
> > Have you manually tested this query in using the pqsl interface? Perhaps
> > it is the backend having problems and not JDBC.
> >
> > Dave
> >
>
> What do you want to say?
> I run your program. The problem in the postgresql?
>
>
>
> --
> Gabriel López Millán
> Facultad de Informática -Universidad de Murcia
> 30001 Murcia - España (Spain)
> Telf: +34-968-364644 E-mail: gabilm@dif.um.es
>
>
>
^ permalink raw reply [nested|flat] 15+ messages in thread
* RE: wrong documentation and others .....
@ 2000-10-17 08:29 Peter Mount <petermount@maidstone.gov.uk>
0 siblings, 1 reply; 15+ messages in thread
From: Peter Mount @ 2000-10-17 08:29 UTC (permalink / raw)
To: 'dhjr@hddesign.com' <dhjr@hddesign.com>; Gabriel Lopez <gabilm@dif.um.es>; +Cc: pgsql-interfaces
I've some experience of Solaris, and now I'm back at work I've got access to
a few Solaris boxes.
Anyhow, catching up with this thread:
* the fail is in the loop reading the result:
sometime a 'E' element is return after a 'Z'
This is a protocol problem, and it would be useful to know if it happens
outside of jdbc. psql won't do in this case, as lo_import() runs locally not
over the network.
* I've read in some Java Usenet groups that class
files are not as Write-Once-Read-Everywhere as Sun would like us
to believe.
This is true to a point. It depends on how pure the javac implementation is,
and how pure the java source is. I've tried to keep the JDBC source as pure
as possible, although I can only test it out under Linux & Windows, but it
should be fine with Solaris. It would be interesting to see if there are any
differences between postgresql.jar compiled under Linux & Solaris.
* FATAL 1: my bits moved right off the end of the world!
Recreate index pg_attribute_relid_attnam_index.
This is internal to postgresql. It's one of my favourite error messages,
although I've never had it myself, so I've not had to fix it before.
* InputStream is = rs.getBinaryInputStream(1);
* // use the stream in some way here
* is.close();
This should work, as it reads the entire LargeObject into a
ByteArrayInputStream(), which is what's actually returned. However, the next
release should return a LargeObjectInputStream object, which reads from the
backend as and when required. This should be done by the weekend.
Peter
--
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount@maidstone.gov.uk
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council
-----Original Message-----
From: David Huttleston Jr [mailto:dhjr@hddesign.com]
Sent: Monday, October 16, 2000 9:20 PM
To: Gabriel Lopez
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] wrong documentation and others .....
Peter Mount's JDBC driver translates the query results from the postgresql
process to Java via the JDBC standard. As I see it, the source of your
problem
can be at several levels.
1) A bug in the program
2) A bug in the Solaris JVM
3) A problem with the JDBC driver
4) A problem with your postgresql config on the solaris
#1 seems unlikely since your program and mine work on linux but not on
solaris
#2 seems unlikely since Solaris is the flagship for Sun's Java efforts
#3 is possible, but our programs _and_ JDBC work fine under linux
#4 is the only possibility we have not discussed.
The first way to test if the solaris configuration of postgresql is the
problem
is to test a query using an interface which is _not_ JDBC. The simpliest,
is
psql. Test the large-object support using lo_import and lo_export from
within
psql. In the documentation, section IV (Interfaces)-- chapter 51 (Large
Objects)
has a page called 'Built in registered functions'. This page shows an
example of how
to 'manually' store and retrieve a large-object which can be typed into the
psql
interface and tested.
If lo_import and lo_export work, but JDBC does _not_ work. We should get
Peter
Mount's direct attention. I don't know if he's familiar with solaris, but
might be
able to point you toward a solution based on your stack trace.
Buena Suerte,
Dave
On Mon, 16 Oct 2000 18:42:17 +0200, you wrote:
> David Huttleston Jr escribió:
>
> > Hey Gabi,
> > Have you manually tested this query in using the pqsl interface?
Perhaps
> > it is the backend having problems and not JDBC.
> >
> > Dave
> >
>
> What do you want to say?
> I run your program. The problem in the postgresql?
>
>
>
> --
> Gabriel López Millán
> Facultad de Informática -Universidad de Murcia
> 30001 Murcia - España (Spain)
> Telf: +34-968-364644 E-mail: gabilm@dif.um.es
>
>
>
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-11-13 12:13 Gabriel Lopez <gabilm@dif.um.es>
parent: Peter Mount <petermount@maidstone.gov.uk>
0 siblings, 1 reply; 15+ messages in thread
From: Gabriel Lopez @ 2000-11-13 12:13 UTC (permalink / raw)
To: Peter Mount <petermount@maidstone.gov.uk>; +Cc: 'dhjr@hddesign.com' <dhjr@hddesign.com>; pgsql-interfaces
Response to late, sorry but I am going out.
Peter Mount escribió:
> I've some experience of Solaris, and now I'm back at work I've got access to
> a few Solaris boxes.
>
> Anyhow, catching up with this thread:
>
> * the fail is in the loop reading the result:
> sometime a 'E' element is return after a 'Z'
>
> This is a protocol problem, and it would be useful to know if it happens
> outside of jdbc. psql won't do in this case, as lo_import() runs locally not
> over the network.
>
The error appear also in linux with RedHat 6.2 and postgresql 7.0.2
I'm using the example from psql:
insert into tbl_objectshelf values
('39',lo_import('/etc/inittab'));
with:
Table "tbl_objectshelf"
Attribute | Type | Modifier
-----------+---------+----------
id | integer | not null
object | oid |
Index: tbl_objectshelf_pkey
when I run the example several times 50, 100, etc the exception is
thows:
FATAL 1: my bits moved right off the end of the world!
Recreate index pg_attribute_relid_attnum_index.
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
>
> * I've read in some Java Usenet groups that class
> files are not as Write-Once-Read-Everywhere as Sun would like us
> to believe.
>
> This is true to a point. It depends on how pure the javac implementation is,
> and how pure the java source is. I've tried to keep the JDBC source as pure
> as possible, although I can only test it out under Linux & Windows, but it
> should be fine with Solaris. It would be interesting to see if there are any
> differences between postgresql.jar compiled under Linux & Solaris.
>
> * FATAL 1: my bits moved right off the end of the world!
> Recreate index pg_attribute_relid_attnam_index.
>
> This is internal to postgresql. It's one of my favourite error messages,
> although I've never had it myself, so I've not had to fix it before.
>
> * InputStream is = rs.getBinaryInputStream(1);
> * // use the stream in some way here
> * is.close();
>
> This should work, as it reads the entire LargeObject into a
> ByteArrayInputStream(), which is what's actually returned. However, the next
> release should return a LargeObjectInputStream object, which reads from the
> backend as and when required. This should be done by the weekend.
>
> Peter
>
> --
> Peter Mount
> Enterprise Support Officer, Maidstone Borough Council
> Email: petermount@maidstone.gov.uk
> WWW: http://www.maidstone.gov.uk
> All views expressed within this email are not the views of Maidstone Borough
> Council
>
> -----Original Message-----
> From: David Huttleston Jr [mailto:dhjr@hddesign.com]
> Sent: Monday, October 16, 2000 9:20 PM
> To: Gabriel Lopez
> Cc: pgsql-interfaces@postgresql.org
> Subject: Re: [INTERFACES] wrong documentation and others .....
>
> Peter Mount's JDBC driver translates the query results from the postgresql
> process to Java via the JDBC standard. As I see it, the source of your
> problem
> can be at several levels.
>
> 1) A bug in the program
> 2) A bug in the Solaris JVM
> 3) A problem with the JDBC driver
> 4) A problem with your postgresql config on the solaris
>
> #1 seems unlikely since your program and mine work on linux but not on
> solaris
> #2 seems unlikely since Solaris is the flagship for Sun's Java efforts
> #3 is possible, but our programs _and_ JDBC work fine under linux
> #4 is the only possibility we have not discussed.
>
> The first way to test if the solaris configuration of postgresql is the
> problem
> is to test a query using an interface which is _not_ JDBC. The simpliest,
> is
> psql. Test the large-object support using lo_import and lo_export from
> within
> psql. In the documentation, section IV (Interfaces)-- chapter 51 (Large
> Objects)
> has a page called 'Built in registered functions'. This page shows an
> example of how
> to 'manually' store and retrieve a large-object which can be typed into the
> psql
> interface and tested.
> If lo_import and lo_export work, but JDBC does _not_ work. We should get
> Peter
> Mount's direct attention. I don't know if he's familiar with solaris, but
> might be
> able to point you toward a solution based on your stack trace.
> Buena Suerte,
> Dave
>
> On Mon, 16 Oct 2000 18:42:17 +0200, you wrote:
> > David Huttleston Jr escribió:
> >
> > > Hey Gabi,
> > > Have you manually tested this query in using the pqsl interface?
> Perhaps
> > > it is the backend having problems and not JDBC.
> > >
> > > Dave
> > >
> >
> > What do you want to say?
> > I run your program. The problem in the postgresql?
> >
> >
> >
> > --
> > Gabriel López Millán
> > Facultad de Informática -Universidad de Murcia
> > 30001 Murcia - España (Spain)
> > Telf: +34-968-364644 E-mail: gabilm@dif.um.es
> >
> >
> >
--
Gabriel López Millán
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-11-13 15:59 Tom Lane <tgl@sss.pgh.pa.us>
parent: Gabriel Lopez <gabilm@dif.um.es>
0 siblings, 1 reply; 15+ messages in thread
From: Tom Lane @ 2000-11-13 15:59 UTC (permalink / raw)
To: Gabriel Lopez <gabilm@dif.um.es>; +Cc: Peter Mount <petermount@maidstone.gov.uk>; 'dhjr@hddesign.com' <dhjr@hddesign.com>; pgsql-interfaces
Gabriel Lopez <gabilm@dif.um.es> writes:
> The error appear also in linux with RedHat 6.2 and postgresql 7.0.2
> I'm using the example from psql:
> insert into tbl_objectshelf values
> ('39',lo_import('/etc/inittab'));
> when I run the example several times 50, 100, etc the exception is
> thows:
> FATAL 1: my bits moved right off the end of the world!
> Recreate index pg_attribute_relid_attnum_index.
We've heard a couple reports of this failure during large-object creation,
but I've never had any luck duplicating the problem :-(
regards, tom lane
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-11-14 08:24 Gabriel Lopez <gabilm@dif.um.es>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 15+ messages in thread
From: Gabriel Lopez @ 2000-11-14 08:24 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Peter Mount <petermount@maidstone.gov.uk>; 'dhjr@hddesign.com' <dhjr@hddesign.com>; pgsql-interfaces
Well, when can I report this error? This is very important for me
Tom Lane escribió:
> Gabriel Lopez <gabilm@dif.um.es> writes:
> > The error appear also in linux with RedHat 6.2 and postgresql 7.0.2
> > I'm using the example from psql:
>
> > insert into tbl_objectshelf values
> > ('39',lo_import('/etc/inittab'));
>
> > when I run the example several times 50, 100, etc the exception is
> > thows:
>
> > FATAL 1: my bits moved right off the end of the world!
> > Recreate index pg_attribute_relid_attnum_index.
>
> We've heard a couple reports of this failure during large-object creation,
> but I've never had any luck duplicating the problem :-(
>
> regards, tom lane
--
Gabriel López Millán
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: wrong documentation and others .....
@ 2000-11-14 15:21 Tom Lane <tgl@sss.pgh.pa.us>
parent: Gabriel Lopez <gabilm@dif.um.es>
0 siblings, 0 replies; 15+ messages in thread
From: Tom Lane @ 2000-11-14 15:21 UTC (permalink / raw)
To: Gabriel Lopez <gabilm@dif.um.es>; +Cc: Peter Mount <petermount@maidstone.gov.uk>; 'dhjr@hddesign.com' <dhjr@hddesign.com>; pgsql-interfaces
Gabriel Lopez <gabilm@dif.um.es> writes:
> Well, when can I report this error? This is very important for me
When you can produce a self-contained test case that others can
replicate ;-). I've tried several times to find this problem on
the basis of bug reports that were about as detailed as the one
you just gave, and had no luck. I'm not going to spend more time
on it until I have a reproducible test case to work on.
regards, tom lane
^ permalink raw reply [nested|flat] 15+ messages in thread
end of thread, other threads:[~2000-11-14 15:21 UTC | newest]
Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-10-05 10:59 wrong documentation and others ..... Gabriel Lopez <gabilm@dif.um.es>
2000-10-05 11:15 ` Troels Jegbjaerg Moerch <tjm2@mail.ikasths.dk>
2000-10-05 11:36 ` Gabriel Lopez <gabilm@dif.um.es>
2000-10-06 11:51 ` Gabriel Lopez <gabilm@dif.um.es>
2000-10-06 22:58 ` David Huttleston Jr <dhjr@hddesign.com>
2000-10-09 09:01 ` Gabriel Lopez <gabilm@dif.um.es>
2000-10-12 21:36 Re: wrong documentation and others ..... David Huttleston Jr <dhjr@hddesign.com>
2000-10-13 07:30 ` Gabriel Lopez <gabilm@dif.um.es>
2000-10-16 16:24 ` Gabriel Lopez <gabilm@dif.um.es>
2000-10-16 20:20 Re: wrong documentation and others ..... David Huttleston Jr <dhjr@hddesign.com>
2000-10-17 08:29 RE: wrong documentation and others ..... Peter Mount <petermount@maidstone.gov.uk>
2000-11-13 12:13 ` Gabriel Lopez <gabilm@dif.um.es>
2000-11-13 15:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-11-14 08:24 ` Gabriel Lopez <gabilm@dif.um.es>
2000-11-14 15:21 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox