pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC and long TEXT fields
8+ messages / 7 participants
[nested] [flat]

* JDBC and long TEXT fields
@ 2000-12-03 03:33 Bryan (Mailing Lists) <bryan_lists@netmeme.org>
  2000-12-03 03:50 ` Re: JDBC and long TEXT fields Greg Speegle <Greg@10happythings.com>
  2000-12-03 04:28 ` Re: JDBC and long TEXT fields Thomas Lockhart <lockhart@alumni.caltech.edu>
  2000-12-03 07:39 ` Re: JDBC and long TEXT fields Robert B. Easter <reaster@comptechnews.com>
  0 siblings, 3 replies; 8+ messages in thread

From: Bryan \(Mailing Lists\) @ 2000-12-03 03:33 UTC (permalink / raw)
  To: pgsql-interfaces

I am trying to insert rows into a table containing a field of type "TEXT".
The documentation says there is no limit to the size of this field; yet,
when I try to insert or update a row with a field contents of around 10k, I
get an error from the JDBC driver:

The SQL Statement is too long - insert into Customer_History (id,
id_customer, id_admin, timestamp, description) values (2021, 37515, null,
'2000-12-02 21:29:48.279', '...very very very long TEXT field')

        at org.postgresql.Connection.ExecSQL(Connection.java:324)
        at org.postgresql.jdbc2.Statement.execute(Statement.java:273)
        at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
        at
org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java:
126)


I am using jdbc7.0.2-1.2.jar.

Any help would be appreciated.

Thank you in advance,
Bryan





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC and long TEXT fields
  2000-12-03 03:33 JDBC and long TEXT fields Bryan (Mailing Lists) <bryan_lists@netmeme.org>
@ 2000-12-03 03:50 ` Greg Speegle <Greg@10happythings.com>
  2000-12-04 20:25   ` Re: JDBC and long TEXT fields Joseph Shraibman <jks@selectacast.net>
  2 siblings, 1 reply; 8+ messages in thread

From: Greg Speegle @ 2000-12-03 03:50 UTC (permalink / raw)
  To: Bryan (Mailing Lists) <bryan_lists@netmeme.org>; +Cc: pgsql-interfaces


There is actually an 8K (or so) limit to text field length. Although I 
believe that is going away
soon, if it hasn't already.

For text fields of that length you have to use Blobs. In fact, as I 
understand it, eventually the
JDBC driver will do this for you automatically.

Greg Speegle
Baylor University

Bryan (Mailing Lists) wrote:

> I am trying to insert rows into a table containing a field of type "TEXT".
> The documentation says there is no limit to the size of this field; yet,
> when I try to insert or update a row with a field contents of around 10k, I
> get an error from the JDBC driver:
> 
> The SQL Statement is too long - insert into Customer_History (id,
> id_customer, id_admin, timestamp, description) values (2021, 37515, null,
> '2000-12-02 21:29:48.279', '...very very very long TEXT field')
> 
>         at org.postgresql.Connection.ExecSQL(Connection.java:324)
>         at org.postgresql.jdbc2.Statement.execute(Statement.java:273)
>         at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
>         at
> org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java:
> 126)
> 
> 
> I am using jdbc7.0.2-1.2.jar.
> 
> Any help would be appreciated.
> 
> Thank you in advance,
> Bryan
> 
> 
> 
> 




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC and long TEXT fields
  2000-12-03 03:33 JDBC and long TEXT fields Bryan (Mailing Lists) <bryan_lists@netmeme.org>
  2000-12-03 03:50 ` Re: JDBC and long TEXT fields Greg Speegle <Greg@10happythings.com>
@ 2000-12-04 20:25   ` Joseph Shraibman <jks@selectacast.net>
  0 siblings, 0 replies; 8+ messages in thread

From: Joseph Shraibman @ 2000-12-04 20:25 UTC (permalink / raw)
  To: Greg Speegle <Greg@10happythings.com>; pgsql-interfaces

Greg Speegle wrote:
> 
> There is actually an 8K (or so) limit to text field length. Although I
> believe that is going away
> soon, if it hasn't already.

There is an 8K limit on the size of a tuple, not the text field.  You
can recompile postgres to make the limit higher, but until 7.1 the limit
will not go away.

-- 
Joseph Shraibman
jks@selectacast.net
Increase signal to noise ratio.  http://www.targabot.com



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC and long TEXT fields
  2000-12-03 03:33 JDBC and long TEXT fields Bryan (Mailing Lists) <bryan_lists@netmeme.org>
@ 2000-12-03 04:28 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
  2000-12-03 04:40   ` Re: JDBC and long TEXT fields Bryan (Mailing Lists) <bryan_lists@netmeme.org>
  2 siblings, 1 reply; 8+ messages in thread

From: Thomas Lockhart @ 2000-12-03 04:28 UTC (permalink / raw)
  To: Bryan (Mailing Lists) <bryan_lists@netmeme.org>; +Cc: pgsql-interfaces

> I am trying to insert rows into a table containing a field of type "TEXT".
> The documentation says there is no limit to the size of this field; yet,
> when I try to insert or update a row with a field contents of around 10k, I
> get an error from the JDBC driver...

As Greg points out, there is an upper limit. I would hope that the docs
say that TEXT has no *fixed* limit, unlike SQL9x types char() and
varchar().

Let us know if that is not what the docs say (and where they don't say
that ;) and we'll get them fixed up. Though for the next release there
is only a huge upper limit, in principle.

                   - Thomas



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC and long TEXT fields
  2000-12-03 03:33 JDBC and long TEXT fields Bryan (Mailing Lists) <bryan_lists@netmeme.org>
  2000-12-03 04:28 ` Re: JDBC and long TEXT fields Thomas Lockhart <lockhart@alumni.caltech.edu>
@ 2000-12-03 04:40   ` Bryan (Mailing Lists) <bryan_lists@netmeme.org>
  2000-12-03 09:38     ` Re: JDBC and long TEXT fields Cedar Cox <cedarc@visionforisrael.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Bryan \(Mailing Lists\) @ 2000-12-03 04:40 UTC (permalink / raw)
  To: pgsql-interfaces

Looking at the User's Guide, Chapter 3, Character Types:

http://www.postgresql.org/docs/user/x1069.htm

It describes char, char(n), text, and varchar(n).

char is described as "single character"
char(n) is described as "fixed length"
text is described as "variable-length"
varchar(n) is described as "variable-length with limit"

Since three out of four of these types are described as having limits, my
interpretation is that the TEXT type does not have any limit. Evidently that
was a faulty assumption on my part, but the docs could stand to be a little
more clear.

Docs aside, I'm looking for a data type that will hold lengthy stings, > 8k.
Evidently a blob is what I need to use? But I don't see blobs listed as a
data type under Table 3-1, "Postgres Data Types".

http://www.postgresql.org/docs/user/datatype.htm

More direction would be appreciated..

Thanks again in advance,
Bryan


----- Original Message -----
From: "Thomas Lockhart" <lockhart@alumni.caltech.edu>
To: "Bryan (Mailing Lists)" <bryan_lists@netmeme.org>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Saturday, December 02, 2000 9:28 PM
Subject: Re: [INTERFACES] JDBC and long TEXT fields


> > I am trying to insert rows into a table containing a field of type
"TEXT".
> > The documentation says there is no limit to the size of this field; yet,
> > when I try to insert or update a row with a field contents of around
10k, I
> > get an error from the JDBC driver...
>
> As Greg points out, there is an upper limit. I would hope that the docs
> say that TEXT has no *fixed* limit, unlike SQL9x types char() and
> varchar().
>
> Let us know if that is not what the docs say (and where they don't say
> that ;) and we'll get them fixed up. Though for the next release there
> is only a huge upper limit, in principle.
>
>                    - Thomas




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC and long TEXT fields
  2000-12-03 03:33 JDBC and long TEXT fields Bryan (Mailing Lists) <bryan_lists@netmeme.org>
  2000-12-03 04:28 ` Re: JDBC and long TEXT fields Thomas Lockhart <lockhart@alumni.caltech.edu>
  2000-12-03 04:40   ` Re: JDBC and long TEXT fields Bryan (Mailing Lists) <bryan_lists@netmeme.org>
@ 2000-12-03 09:38     ` Cedar Cox <cedarc@visionforisrael.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Cedar Cox @ 2000-12-03 09:38 UTC (permalink / raw)
  To: Bryan (Mailing Lists) <bryan_lists@netmeme.org>; +Cc: pgsql-interfaces


On Sat, 2 Dec 2000, Bryan (Mailing Lists) wrote:
> 
> Docs aside, I'm looking for a data type that will hold lengthy stings, > 8k.
> Evidently a blob is what I need to use? But I don't see blobs listed as a
> data type under Table 3-1, "Postgres Data Types".
> 
> http://www.postgresql.org/docs/user/datatype.htm
> 
> More direction would be appreciated..
> 
> Thanks again in advance,
> Bryan

My understanding is that JDBC blobs == PG large objects.  The data type
you'll need to use is OID (Object ID).  Have a look in the docs under
interfaces, Large Objects (largeobjects.htm) and JDBC (jdbc.htm)

-Cedar





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC and long TEXT fields
  2000-12-03 03:33 JDBC and long TEXT fields Bryan (Mailing Lists) <bryan_lists@netmeme.org>
@ 2000-12-03 07:39 ` Robert B. Easter <reaster@comptechnews.com>
  2 siblings, 0 replies; 8+ messages in thread

From: Robert B. Easter @ 2000-12-03 07:39 UTC (permalink / raw)
  To: Bryan \(Mailing Lists\) <bryan_lists@netmeme.org>; pgsql-interfaces

Here are the last two entries from the PostgreSQL 7.0.3 
/src/interfaces/jdbc/CHANGELOG:

Tue Jun 06 12:00:00 BST 2000 petermount@it.maidstone.gov.uk
        - Added org/postgresql/DriverClass.java to the list of files removed
          by make clean (it's dynamically built)
        - Fixed Statement, so that the update count is valid when an SQL
          DELETE operation is done.
        - While fixing the update count, made it easier to get the OID of
          the last insert as well. Example is in example/basic.java
 
Tue Jun 06 08:37:00 BST 2000 petermount@it.maidstone.gov.uk
        - Removed a hardwired 8K limit on query strings
        - Added some missing org.'s in Connection that prevented
          the use of the geometric types.
                                                            

This one above says it removed the 8k limit on query strings.  I can't 
remember all the release dates of 7.0.2 etc, but maybe these changes above 
only made it into 7.0.3, not 7.0.2.

The jar file is now just called postgresql.jar in 7.0.3.

Hope this info is helpful.


On Saturday 02 December 2000 22:33, Bryan \(Mailing Lists\) wrote:
> I am trying to insert rows into a table containing a field of type "TEXT".
> The documentation says there is no limit to the size of this field; yet,
> when I try to insert or update a row with a field contents of around 10k, I
> get an error from the JDBC driver:
>
> The SQL Statement is too long - insert into Customer_History (id,
> id_customer, id_admin, timestamp, description) values (2021, 37515, null,
> '2000-12-02 21:29:48.279', '...very very very long TEXT field')
>
>         at org.postgresql.Connection.ExecSQL(Connection.java:324)
>         at org.postgresql.jdbc2.Statement.execute(Statement.java:273)
>         at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
>         at
> org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java
>: 126)
>
>
> I am using jdbc7.0.2-1.2.jar.
>
> Any help would be appreciated.
>
> Thank you in advance,
> Bryan

-- 
-------- Robert B. Easter  reaster@comptechnews.com ---------
- CompTechNews Message Board   http://www.comptechnews.com/ -
- CompTechServ Tech Services   http://www.comptechserv.com/ -
---------- http://www.comptechnews.com/~reaster/ ------------



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* RE: JDBC and long TEXT fields
@ 2000-12-05 14:01 Peter Mount <petermount@maidstone.gov.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Peter Mount @ 2000-12-05 14:01 UTC (permalink / raw)
  To: 'Robert B. Easter' <reaster@comptechnews.com>; Bryan (Mailing Lists) <bryan_lists@netmeme.org>; pgsql-interfaces

> The jar file is now just called postgresql.jar in 7.0.3.

It's always has been called postgresql.jar. It's only the precompiled jar's
I publish that have the version number in them to distinguish between them.

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



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2000-12-05 14:01 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-03 03:33 JDBC and long TEXT fields Bryan (Mailing Lists) <bryan_lists@netmeme.org>
2000-12-03 03:50 ` Greg Speegle <Greg@10happythings.com>
2000-12-04 20:25   ` Joseph Shraibman <jks@selectacast.net>
2000-12-03 04:28 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-12-03 04:40   ` Bryan (Mailing Lists) <bryan_lists@netmeme.org>
2000-12-03 09:38     ` Cedar Cox <cedarc@visionforisrael.com>
2000-12-03 07:39 ` Robert B. Easter <reaster@comptechnews.com>
2000-12-05 14:01 RE: JDBC and long TEXT fields Peter Mount <petermount@maidstone.gov.uk>

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