bytea SQL ERROR with size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lionel pacoud

    bytea SQL ERROR with size

    Hi,

    ok, so I have pictures that I store in Postgres (7.2.4) via JDBC.
    if the size of my picture is small (less than 1ko) it's ok, there is
    no pb.
    but I never succed to put a bigger picture.
    the response is :
    java.sql.SQLExc eption: ERROR: index_formtuple : data takes 211980
    bytes, max is 8191... or
    java.sql.SQLExc eption: ERROR: btree: index item size 2768 exceeds
    maximum 2713...

    it depends of the size of the picture...

    I tried to use Large Object instead of bytea but, there is a
    ClassCastExcept ion when I do this :
    LargeObjectMana ger lobj =
    ((org.postgresq l.Connection)co nn).getLargeObj ectAPI();

    Conclusion, I really need help. I don't see any solutions.

    well, thanks for your help.
    lionel
  • lionel pacoud

    #2
    Re: bytea SQL ERROR with size

    Ok,
    so i found a solultion (maybe it could help someone else):
    it seems that postgres doesn't accept unique constraint on bytea of
    size bigger than 1ko
    if I remove the unique constraint, it's OK.

    Comment

    Working...