Using Image datatype in Postgres

Using Image datatype in Postgres

Post by Prachi Jai » Wed, 18 Dec 2002 21:27:30



Hello All,

I am migrating from MSSQLServer to Postgres. I was using image
datatype in one of my table. Is there any replacement for the same
in Postgres???

Please guide.
thanks and regards
Prachi Jain

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

 
 
 

Using Image datatype in Postgres

Post by Medi Montase » Thu, 19 Dec 2002 04:12:38


create SomeTable
(
    name varchar(10),
    image oid
);
insert into SomeTable (name, image) values ('foo.gif',
lo_import('/web/some.gif'));

ie

Bag of Bits is called Large Objects in PG and you'll use a couple of
auxilary methods
to handle them; lo_import() and lo_export().

I myself don't understand the relation between OID and Large Object....
Could be historic stuff....or when I read it, i was sleepy....


> Hello All,

> I am migrating from MSSQLServer to Postgres. I was using image
> datatype in one of my table. Is there any replacement for the same in
> Postgres???

> Please guide.
> thanks and regards
> Prachi Jain

> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?

> http://archives.postgresql.org

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

 
 
 

Using Image datatype in Postgres

Post by scott.marlow » Thu, 19 Dec 2002 04:31:49


Also, you can use bytea types to hold binary data, but you have to encode
it first.  Advantage is that you don't have to use lo support to get your
data in and out.


> create SomeTable
> (
>     name varchar(10),
>     image oid
> );
> insert into SomeTable (name, image) values ('foo.gif',
> lo_import('/web/some.gif'));

> ie

> Bag of Bits is called Large Objects in PG and you'll use a couple of
> auxilary methods
> to handle them; lo_import() and lo_export().

> I myself don't understand the relation between OID and Large Object....
> Could be historic stuff....or when I read it, i was sleepy....


> > Hello All,

> > I am migrating from MSSQLServer to Postgres. I was using image
> > datatype in one of my table. Is there any replacement for the same in
> > Postgres???

> > Please guide.
> > thanks and regards
> > Prachi Jain

> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?

> > http://archives.postgresql.org

> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?

> http://archives.postgresql.org

---------------------------(end of broadcast)---------------------------