type bytea and large objects

From: Mateu Batle <mbatle(at)iname(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: type bytea and large objects
Date: 2000-12-19 20:54:45
Message-ID: 3A3FCB15.5060700@iname.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I'm pretty new in PostgreSQL and I have some problems and
questions. I'll list them here, maybe someone can help me :)

1) I wanted to use a binary type. I've seen in some place a
type called bytea which I can use, but I cannot use it
as a primary key. Is that possible somehow or with another
type ?

The message I get when trying to use it as primary key is:

ERROR: DefineIndex: type bytea has no default operator class

2) If I use '\000' in a bytea string, what comes after the nul
value is really stored in the database ?

3) Because of these problems I have used text instead of bytea
and used base 64 encoding. The size of a row is limited to 8 Kbytes,
so I'm also using large objects (BLOB) in the case is larger.
But large objects are implemented using files in the
filesystem, which I think is a bit poor in performance.
With the current large object API is only possible to grow
the large objects, but no to shrink them.
Is there any way to do a truncate operation on a large object ?

Cheers,
Mateu

Browse pgsql-general by date

  From Date Subject
Next Message Tulio Oliveira 2000-12-19 21:39:53 Trigger with superuser privileges
Previous Message Mike Castle 2000-12-19 20:22:04 Re: TODAY and CURRENT?