BLOBS and PostgreSQL - Mailing list pgsql-general

From Paulo Parola
Subject BLOBS and PostgreSQL
Date
Msg-id 002501beef0f$641813c0$0300000a@cpqivx-2
Whole thread Raw
List pgsql-general
Hi,

I need to create a table to store images (BLOBs - binary large objects) in
PostgreSQL as I would do in MySQL like below:

create table images (
  id INT NOT NULL PRIMARY KEY,
  image BLOB
);

MySQL has actually 4 different types for a BLOB, as below:

TINYBLOB, TINYTEXT           L+1 bytes, where L < 2^8
BLOB, TEXT                        L+2 bytes, where L < 2^16
MEDIUMBLOB, MEDIUMTEXT   L+3 bytes, where L < 2^24
LONGBLOB, LONGTEXT          L+4 bytes, where L < 2^32

Which types in PostgreSQL should I use for this purpose (storing BLOBs)?
text? varchar(n)? Documentation for PostgreSQL is unfortunately really poor
if compared to MySQL...

TIA,
Paulo


pgsql-general by date:

Previous
From: "Jeff MacDonald "
Date:
Subject: Re: [GENERAL] PostgreSQL, Inc Site Redone ...
Next
From: Jens Felber
Date:
Subject: Re: [GENERAL] changing between 6.4.1 and 6.5