From gabilm@dif.um.es Thu Oct 5 11:01:12 2000 Received: from pirania.dif.um.es (IDENT:root@pirania.dif.um.es [155.54.210.33]) by hub.org (8.10.1/8.10.1) with ESMTP id e95B1C785926 for ; Thu, 5 Oct 2000 07:01:12 -0400 (EDT) Received: from dif.um.es (IDENT:gabilm@pirania.dif.um.es [127.0.0.1]) by pirania.dif.um.es (8.9.3/8.9.3) with ESMTP id MAA03354 for ; Thu, 5 Oct 2000 12:59:56 +0200 Message-ID: <39DC5F29.E9F4023@dif.um.es> Date: Thu, 05 Oct 2000 12:59:53 +0200 From: Gabriel Lopez X-Mailer: Mozilla 4.72 [es] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: psql Subject: wrong documentation and others ..... Content-Type: multipart/alternative; boundary="------------9A3320E3184A86C706925506" X-Archive-Number: 200010/13 --------------9A3320E3184A86C706925506 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 --------------9A3320E3184A86C706925506 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit  

    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
  --------------9A3320E3184A86C706925506-- From tjm2@mail.ikasths.dk Thu Oct 5 11:14:02 2000 Received: from mail.ikasths.dk (mail.ikasths.dk [212.237.188.3]) by hub.org (8.10.1/8.10.1) with ESMTP id e95BE2789028 for ; Thu, 5 Oct 2000 07:14:02 -0400 (EDT) Received: from pc4151 ([212.237.191.151]) by mail.ikasths.dk (Post.Office MTA v3.5.2 release 221 ID# 0-62113U3000L300S0V35) with SMTP id dk for ; Thu, 5 Oct 2000 13:13:52 +0200 Message-ID: <004f01c02ebd$8f30a380$97bfedd4@pc4151> From: tjm2@mail.ikasths.dk (Troels Jegbjaerg Moerch) To: "psql" References: <39DC5F29.E9F4023@dif.um.es> Subject: Re: wrong documentation and others ..... Date: Thu, 5 Oct 2000 13:15:24 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004C_01C02ECE.527ABCD0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200010/14 This is a multi-part message in MIME format. ------=_NextPart_000_004C_01C02ECE.527ABCD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi try this:=20=20=20 File file =3D new File("myimage.gif");=20 FileInputStream fis =3D new FileInputStream(file);=20 byte[] theByteArray =3D new byte[fis.available()]; fis.read(theByteArray); =20=20=20 PreparedStatement ps =3D con.prepareStatement("insert insert into images= values (?,?)"); ps.setString(1,file.getName());=20 ps.setBytes(2, theByteArray); ps.execute(); con.commit(); ps.close(); fis.close(); =20=20=20 TJM ----- Original Message -----=20 From: Gabriel Lopez=20 To: psql=20 Sent: Thursday, October 05, 2000 12:59 PM Subject: [INTERFACES] wrong documentation and others ..... =20=20=20=20 Hi all.=20 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, i= n chapter 58 of PosgreSQL tutorial (JDBC Interfaces) it repot who to work w= ith Large Object and give code that is wrong:=20 File file =3D new File("myimage.gif");=20 FileInputStream fis =3D new FileInputStream(file);=20 PreparedStatement ps =3D conn.prepareStatement("insert into image= s values (?,?)");=20 ps.setString(1,file.getName());=20 ps.setBinaryStream(2,fis,file.length());=20 ps.executeUpdate();=20 ps.close();=20 fis.close();=20 PreparedStatement ps =3D con.prepareStatement("select oid from im= ages where name=3D?");=20 ps.setString(1,"myimage.gif");=20 ResultSet rs =3D ps.executeQuery();=20 if(rs!=3Dnull) {=20 while(rs.next()) {=20 InputStream is =3D rs.getBinaryInputStream(1);=20 // use the stream in some way here=20 is.close();=20 }=20 rs.close();=20 }=20 ps.close();=20 =20=20=20=20 InputStream ARE NOT SUPPORTED in JDBC implementation =A1=BF?=A1 a= nd "getBinaryInputStream()" really is "getBinaryStream()". I think that it= is very serious. The other method (that I know) is using LargeObjectAPI, b= ut this fail every 9 times of PreparedStatement of setObject() sentence =A1= =A1=A1 and when use LargeObjectManager as in source examples. (I send other= messages to list)=20 =20=20=20=20 Has PostgreSQL any way to work WELL with LargeObject.?=20 Please reply me.=20 Cheers, Gabi.=20 =20=20=20=20 --=20 Gabriel L=F3pez Mill=E1n=20=20=20=20 Facultad de Inform=E1tica -Universidad de Murcia 30001 Murcia - Espa=F1a (Spain) Telf: +34-968-364644 E-mail: gabilm@dif.um.es =20=20=20=20 ------=_NextPart_000_004C_01C02ECE.527ABCD0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi try this:   
 
   File file =3D new=20 File("myimage.gif"); 
   FileInputStream fis =3D new= =20 FileInputStream(file);

   byte[] theByteArray = =3D new=20 byte[fis.available()];
   fis.read(theByteArray);
&nbs= p;  
   PreparedStatement=20 ps =3D con.prepareStatement("insert insert into images values=20 (?,?)");
 
  =20 ps.setString(1,file.getName()); 
   ps.setBytes(2,= =20 theByteArray);
   ps.execute();
   con.= commit();
   ps.close();
   fis.close()= ;
   
 
 
TJM
 
 
 
----- Original Message -----
Fro= m:=20 Gabriel Lope= z=20
To: psql
Sent: Thursday, October 05, 2000 1= 2:59=20 PM
Subject: [INTERFACES] wrong docume= ntation=20 and others .....

 =20

    Hi all.=20

    I have several days working with LargeObject and=20 postgres 7.0.2 and I have found many problems. In the first time the=20 postgresql doc is wrong, in chapter 58 of PosgreSQL tutorial (JDBC Interf= aces)=20 it repot who to work with Large Object and give code that is wrong:=20

        File file =3D new=20 File("myimage.gif");
       =20 FileInputStream fis =3D new FileInputStream(file);=20
        PreparedStatement ps =3D= =20 conn.prepareStatement("insert into images values (?,?)");=20
        ps.setString(1,file.getNam= e());=20
       =20 ps.setBinaryStream(2,fis,file.length());=20
        ps.executeUpdate();=20
        ps.close();=20
        fis.close();=20

        PreparedStatement ps =3D=20 con.prepareStatement("select oid from images where name=3D?");=20
        ps.setString(1,"myimage.gi= f");=20
        ResultSet rs =3D=20 ps.executeQuery();
        if(rs!= =3Dnull)=20 {
           = =20 while(rs.next()) {=20
           &nb= sp;   =20 InputStream is =3D rs.getBinaryInputStream(1);=20
           &nb= sp;   =20 // use the stream in some way here=20
           &nb= sp;   =20 is.close();=20
           &nb= sp;   =20 }
           = =20 rs.close();
        }=20
        ps.close();
 =20

        InputStream ARE NOT SUPPORT= ED in=20 JDBC implementation =A1=BF?=A1 and "getBinaryInputStream()" really is=20 "getBinaryStream()".  I think that it is very serious. The other met= hod=20 (that I know) is using LargeObjectAPI, but this fail every 9 times of=20 PreparedStatement of setObject() sentence =A1=A1=A1 and when use LargeObj= ectManager=20 as in source examples. (I send other messages to list)
 =20

        Has PostgreSQL any way to w= ork=20 WELL with LargeObject.?=20

    Please reply me.=20

    Cheers, Gabi.
 

-- 
Gabriel L=F3pez Mill=E1n    
Facultad de Inform=E1tica -Universidad de Murcia
30001 Murcia - Espa=F1a (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
 =20 ------=_NextPart_000_004C_01C02ECE.527ABCD0-- From gabilm@dif.um.es Thu Oct 5 11:37:52 2000 Received: from pirania.dif.um.es (IDENT:root@pirania.dif.um.es [155.54.210.33]) by hub.org (8.10.1/8.10.1) with ESMTP id e95Bbo794728 for ; Thu, 5 Oct 2000 07:37:52 -0400 (EDT) Received: from dif.um.es (IDENT:gabilm@pirania.dif.um.es [127.0.0.1]) by pirania.dif.um.es (8.9.3/8.9.3) with ESMTP id NAA03604 for ; Thu, 5 Oct 2000 13:36:32 +0200 Message-ID: <39DC67BF.A28489A2@dif.um.es> Date: Thu, 05 Oct 2000 13:36:31 +0200 From: Gabriel Lopez X-Mailer: Mozilla 4.72 [es] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 CC: psql Subject: Re: wrong documentation and others ..... References: <39DC5F29.E9F4023@dif.um.es> <004f01c02ebd$8f30a380$97bfedd4@pc4151> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200010/15 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 From gabilm@dif.um.es Fri Oct 6 12:34:40 2000 Received: from pirania.dif.um.es (IDENT:root@pirania.dif.um.es [155.54.210.33]) by hub.org (8.10.1/8.10.1) with ESMTP id e96CYeJ88694 for ; Fri, 6 Oct 2000 08:34:40 -0400 (EDT) Received: from dif.um.es (IDENT:gabilm@pirania.dif.um.es [127.0.0.1]) by pirania.dif.um.es (8.9.3/8.9.3) with ESMTP id NAA01952 for ; Fri, 6 Oct 2000 13:51:27 +0200 Message-ID: <39DDBCBE.BF5F9748@dif.um.es> Date: Fri, 06 Oct 2000 13:51:26 +0200 From: Gabriel Lopez X-Mailer: Mozilla 4.72 [es] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: psql Subject: Re: wrong documentation and others ..... References: <39DC5F29.E9F4023@dif.um.es> <004f01c02ebd$8f30a380$97bfedd4@pc4151> <39DC67BF.A28489A2@dif.um.es> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200010/17 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 From dhjr@hddesign.com Fri Oct 6 22:58:58 2000 Received: from proxy.hddesign.com (proxy.hddesign.com [216.165.162.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e96MwwJ60181 for ; Fri, 6 Oct 2000 18:58:58 -0400 (EDT) Received: from develope.hddesign.com (hddesign-6.hddesign.com [216.165.162.6]) by proxy.hddesign.com (8.9.3/8.9.3) with ESMTP id RAA03305 for ; Fri, 6 Oct 2000 17:58:37 -0500 Date: Fri, 6 Oct 2000 17:58:37 -0500 Message-Id: <200010062258.RAA03305@proxy.hddesign.com> To: pgsql-interfaces@postgresql.org From: David Huttleston Jr Reply-To: dhjr@hddesign.com Subject: Re: wrong documentation and others ..... X-Mailer: Pygmy (v0.4.1) In-Reply-To: <39DC5F29.E9F4023@dif.um.es> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="10.0.0.20.500.1658.970873129.332.13214" X-Archive-Number: 200010/28 This is a multi-part message in MIME format. --10.0.0.20.500.1658.970873129.332.13214 Content-Type: text/plain 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 > > > > --10.0.0.20.500.1658.970873129.332.13214 Content-Type: application/octet-stream; name="Shelf.java" Content-Transfer-Encoding: base64 cGFja2FnZSBQQUN3ZWI7CgppbXBvcnQgamF2YS5zcWwuKjsKaW1wb3J0IGph dmEuaW8uKjsK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JXYXJuaW5ncygpOwogICAg cHNHZXQuY2xlYXJQYXJhbWV0ZXJzKCk7CiAgICBwc0dldC5zZXRTdHJpbmco MSwgaWQudG9TdHJpbmcoKSApOwogICAgUmVzdWx0U2V0IHJzID0gcHNHZXQu ZXhlY3V0ZVF1ZXJ5KCk7CiAgICBPYmplY3Qgb2JqID0gbnVsbDsKCiAgICBp ZiAocnMgIT0gbnVsbCkKICAgIHsKICAgICAgaWYgKCBycy5maXJzdCgpICkK ICAgICAgewogICAgICAgIElucHV0U3RyZWFtIGlzID0gcnMuZ2V0QmluYXJ5 U3RyZWFtKDEpOwogICAgICAgIE9iamVjdElucHV0U3RyZWFtIG9pcyA9IG5l dyBPYmplY3RJbnB1dFN0cmVhbShpcyk7CiAgICAgICAgb2JqID0gb2lzLnJl YWRPYmplY3QoKTsKICAgICAgICBvaXMuY2xvc2UoKTsKICAgICAgICBpcy5j bG9zZSgpOwogICAgICB9CiAgICAgIHJzLmNsb3NlKCk7CiAgICB9CiAgICBy ZXR1cm4gb2JqOwogIH0KCiAgcHJvdGVjdGVkIHZvaWQgZmluYWxpemUoKSB0 aHJvd3MgamF2YS5sYW5nLlRocm93YWJsZQogIHsKICAgIHBzUHV0LmNsb3Nl KCk7CiAgICBwc0dldC5jbG9zZSgpOwogICAgY29uLmNsb3NlKCk7CiAgICBz dXBlci5maW5hbGl6ZSgpOwogIH0KCiAgQ29ubmVjdGlvbiBjb247CiAgUHJl cGFyZWRTdGF0ZW1lbnQgcHNQdXQ7CiAgUHJlcGFyZWRTdGF0ZW1lbnQgcHNH ZXQ7Cn0K --10.0.0.20.500.1658.970873129.332.13214-- From gabilm@dif.um.es Mon Oct 9 09:02:44 2000 Received: from pirania.dif.um.es (IDENT:root@pirania.dif.um.es [155.54.210.33]) by hub.org (8.10.1/8.10.1) with ESMTP id e9992iJ32502 for ; Mon, 9 Oct 2000 05:02:44 -0400 (EDT) Received: from dif.um.es (IDENT:gabilm@pirania.dif.um.es [127.0.0.1]) by pirania.dif.um.es (8.9.3/8.9.3) with ESMTP id LAA12611 for ; Mon, 9 Oct 2000 11:01:28 +0200 Message-ID: <39E18968.E5318C5D@dif.um.es> Date: Mon, 09 Oct 2000 11:01:28 +0200 From: Gabriel Lopez X-Mailer: Mozilla 4.72 [es] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Re: wrong documentation and others ..... References: <200010062258.RAA03305@proxy.hddesign.com> Content-Type: multipart/alternative; boundary="------------5D1975BEA355DC4EDAE75B4C" X-Archive-Number: 200010/38 --------------5D1975BEA355DC4EDAE75B4C Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 --------------5D1975BEA355DC4EDAE75B4C Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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
  --------------5D1975BEA355DC4EDAE75B4C-- From dhjr@hddesign.com Thu Oct 12 21:37:01 2000 Received: from proxy.hddesign.com (proxy.hddesign.com [216.165.162.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e9CLb1r72812 for ; Thu, 12 Oct 2000 17:37:01 -0400 (EDT) Received: from develope.hddesign.com (hddesign-6.hddesign.com [216.165.162.6]) by proxy.hddesign.com (8.9.3/8.9.3) with ESMTP id QAA12035; Thu, 12 Oct 2000 16:36:27 -0500 Date: Thu, 12 Oct 2000 16:36:27 -0500 Message-Id: <200010122136.QAA12035@proxy.hddesign.com> To: Gabriel Lopez Cc: pgsql-interfaces@postgresql.org From: David Huttleston Jr Reply-To: dhjr@hddesign.com Subject: Re: wrong documentation and others ..... X-Mailer: Pygmy (v0.4.1) In-Reply-To: <39E41C3B.E5D5E6FB@dif.um.es> X-Archive-Number: 200010/104 X-Sequence-Number: 1461 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 > > > From gabilm@dif.um.es Fri Oct 13 07:32:06 2000 Received: from pirania.dif.um.es (IDENT:root@pirania.dif.um.es [155.54.210.33]) by hub.org (8.10.1/8.10.1) with ESMTP id e9D7W6r66815 for ; Fri, 13 Oct 2000 03:32:06 -0400 (EDT) Received: from dif.um.es (IDENT:gabilm@pirania.dif.um.es [127.0.0.1]) by pirania.dif.um.es (8.9.3/8.9.3) with ESMTP id JAA02017; Fri, 13 Oct 2000 09:30:03 +0200 Message-ID: <39E6B9FA.67CC858F@dif.um.es> Date: Fri, 13 Oct 2000 09:30:02 +0200 From: Gabriel Lopez X-Mailer: Mozilla 4.72 [es] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: dhjr@hddesign.com CC: pgsql-interfaces@postgresql.org Subject: Re: wrong documentation and others ..... References: <200010122136.QAA12035@proxy.hddesign.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200010/108 X-Sequence-Number: 1465 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 From gabilm@dif.um.es Mon Oct 16 16:27:19 2000 Received: from pirania.dif.um.es (IDENT:root@pirania.dif.um.es [155.54.210.33]) by hub.org (8.10.1/8.11.0) with ESMTP id e9GGRJW43442 for ; Mon, 16 Oct 2000 12:27:19 -0400 (EDT) (envelope-from gabilm@dif.um.es) Received: from dif.um.es (IDENT:gabilm@pirania.dif.um.es [127.0.0.1]) by pirania.dif.um.es (8.9.3/8.9.3) with ESMTP id SAA02537; Mon, 16 Oct 2000 18:24:32 +0200 Message-ID: <39EB2BBC.3EF5AADA@dif.um.es> Date: Mon, 16 Oct 2000 18:24:28 +0200 From: Gabriel Lopez X-Mailer: Mozilla 4.72 [es] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: dhjr@hddesign.com, pgsql-interfaces@postgresql.org Subject: Re: wrong documentation and others ..... References: <200010122136.QAA12035@proxy.hddesign.com> <39E6B9FA.67CC858F@dif.um.es> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200010/124 X-Sequence-Number: 1481 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 From dhjr@hddesign.com Mon Oct 16 20:21:04 2000 Received: from proxy.hddesign.com (proxy.hddesign.com [216.165.162.2]) by hub.org (8.10.1/8.11.0) with ESMTP id e9GKL4W98262 for ; Mon, 16 Oct 2000 16:21:04 -0400 (EDT) (envelope-from dhjr@hddesign.com) Received: from develope.hddesign.com (hddesign-6.hddesign.com [216.165.162.6]) by proxy.hddesign.com (8.9.3/8.9.3) with ESMTP id PAA16531; Mon, 16 Oct 2000 15:20:24 -0500 Date: Mon, 16 Oct 2000 15:20:24 -0500 Message-Id: <200010162020.PAA16531@proxy.hddesign.com> To: Gabriel Lopez Cc: pgsql-interfaces@postgresql.org From: David Huttleston Jr Reply-To: dhjr@hddesign.com Subject: Re: wrong documentation and others ..... X-Mailer: Pygmy (v0.4.1) In-Reply-To: <39EB2FE8.43259D92@dif.um.es> X-Archive-Number: 200010/128 X-Sequence-Number: 1485 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 > > > From petermount@maidstone.gov.uk Tue Oct 17 08:32:00 2000 Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.org (8.10.1/8.11.0) with ESMTP id e9H8W0W00350 for ; Tue, 17 Oct 2000 04:32:00 -0400 (EDT) (envelope-from petermount@maidstone.gov.uk) Received: from mailgate.maidstone.gov.uk ([194.159.6.98] helo=gatekeeper.maidstone.gov.uk) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 13lSAA-00094w-0A; Tue, 17 Oct 2000 08:31:58 +0000 Received: from exchange1.nt.maidstone.gov.uk (exchange1.maidstone.gov.uk [172.16.0.150]) by gatekeeper.maidstone.gov.uk (8.9.3/8.9.3) with ESMTP id JAA30262; Tue, 17 Oct 2000 09:31:58 +0100 Received: by exchange1.nt.maidstone.gov.uk with Internet Mail Service (5.5.2650.21) id ; Tue, 17 Oct 2000 09:29:30 +0100 Message-ID: <1B3D5E532D18D311861A00600865478CF1B432@exchange1.nt.maidstone.gov.uk> From: Peter Mount To: "'dhjr@hddesign.com'" , Gabriel Lopez Cc: pgsql-interfaces@postgresql.org Subject: RE: wrong documentation and others ..... Date: Tue, 17 Oct 2000 09:29:29 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id e9H8W1W00362 X-Archive-Number: 200010/143 X-Sequence-Number: 1500 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 > > > From gabilm@dif.um.es Mon Nov 13 12:18:14 2000 Received: from pirania.dif.um.es (pirania.dif.um.es [155.54.210.33]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eADCIEs69070 for ; Mon, 13 Nov 2000 07:18:14 -0500 (EST) (envelope-from gabilm@dif.um.es) Received: from dif.um.es (IDENT:gabilm@pirania.dif.um.es [127.0.0.1]) by pirania.dif.um.es (8.9.3/8.9.3) with ESMTP id NAA12164; Mon, 13 Nov 2000 13:13:37 +0100 Message-ID: <3A0FDAF0.554766F6@dif.um.es> Date: Mon, 13 Nov 2000 13:13:36 +0100 From: Gabriel Lopez X-Mailer: Mozilla 4.72 [es] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: Peter Mount CC: "'dhjr@hddesign.com'" , pgsql-interfaces@postgresql.org Subject: Re: wrong documentation and others ..... References: <1B3D5E532D18D311861A00600865478CF1B432@exchange1.nt.maidstone.gov.uk> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200011/126 X-Sequence-Number: 162 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 From tgl@sss.pgh.pa.us Mon Nov 13 16:02:41 2000 Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eADG2fs76638 for ; Mon, 13 Nov 2000 11:02:41 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eADFxKD09579; Mon, 13 Nov 2000 10:59:20 -0500 (EST) To: Gabriel Lopez cc: Peter Mount , "'dhjr@hddesign.com'" , pgsql-interfaces@postgresql.org Subject: Re: wrong documentation and others ..... In-reply-to: <3A0FDAF0.554766F6@dif.um.es> References: <1B3D5E532D18D311861A00600865478CF1B432@exchange1.nt.maidstone.gov.uk> <3A0FDAF0.554766F6@dif.um.es> Comments: In-reply-to Gabriel Lopez message dated "Mon, 13 Nov 2000 13:13:36 +0100" Date: Mon, 13 Nov 2000 10:59:20 -0500 Message-ID: <9576.974131160@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200011/128 X-Sequence-Number: 164 Gabriel Lopez 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 From gabilm@dif.um.es Tue Nov 14 08:27:50 2000 Received: from pirania.dif.um.es (pirania.dif.um.es [155.54.210.33]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAE8Ros27025 for ; Tue, 14 Nov 2000 03:27:50 -0500 (EST) (envelope-from gabilm@dif.um.es) Received: from dif.um.es (IDENT:gabilm@pirania.dif.um.es [127.0.0.1]) by pirania.dif.um.es (8.9.3/8.9.3) with ESMTP id JAA13702; Tue, 14 Nov 2000 09:24:04 +0100 Message-ID: <3A10F6A3.5F0CAF2C@dif.um.es> Date: Tue, 14 Nov 2000 09:24:03 +0100 From: Gabriel Lopez X-Mailer: Mozilla 4.72 [es] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane CC: Peter Mount , "'dhjr@hddesign.com'" , pgsql-interfaces@postgresql.org Subject: Re: wrong documentation and others ..... References: <1B3D5E532D18D311861A00600865478CF1B432@exchange1.nt.maidstone.gov.uk> <3A0FDAF0.554766F6@dif.um.es> <9576.974131160@sss.pgh.pa.us> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200011/142 X-Sequence-Number: 178 Well, when can I report this error? This is very important for me Tom Lane escribió: > Gabriel Lopez 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 From tgl@sss.pgh.pa.us Tue Nov 14 15:23:23 2000 Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAEFNNs42518 for ; Tue, 14 Nov 2000 10:23:23 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eAEFLWD02445; Tue, 14 Nov 2000 10:21:32 -0500 (EST) To: Gabriel Lopez cc: Peter Mount , "'dhjr@hddesign.com'" , pgsql-interfaces@postgresql.org Subject: Re: wrong documentation and others ..... In-reply-to: <3A10F6A3.5F0CAF2C@dif.um.es> References: <1B3D5E532D18D311861A00600865478CF1B432@exchange1.nt.maidstone.gov.uk> <3A0FDAF0.554766F6@dif.um.es> <9576.974131160@sss.pgh.pa.us> <3A10F6A3.5F0CAF2C@dif.um.es> Comments: In-reply-to Gabriel Lopez message dated "Tue, 14 Nov 2000 09:24:03 +0100" Date: Tue, 14 Nov 2000 10:21:31 -0500 Message-ID: <2442.974215291@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200011/148 X-Sequence-Number: 184 Gabriel Lopez 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