Skip site navigation (1) Skip section navigation (2)

Storing file in postgresql and accessing them with psycopg

From: Ottavio Campana <ottavio(at)campana(dot)vi(dot)it>
To: psycopg(at)postgresql(dot)org
Subject: Storing file in postgresql and accessing them with psycopg
Date: 2012-01-05 10:29:56
Message-ID: 13433bf780de8cb363c652b87038fc61@localhost (view raw or flat)
Thread:
Lists: psycopg
Hi,

for a project, I'll need to store files in the database, because I won't be
able to write to the disk of the application.

I've been looking online about how to do it, and I've seen that there are
two ways, i.e. with bytea and oid. Particularly I found this page
http://www.zephid.dk/2008/08/09/oid-vs-bytea-in-postgresql/ , it's about
php but it can give a few hints, even though it's more than three years
old.

So, my questions are:

* do you have experience with newer version of postgresql (9.x)? Is there
something particular I need to consider?

* I've read http://packages.python.org/psycopg2/extensions.html , thus I
still think oid is the way to go, but I haven't been able to find an
example to use as reference. Can you please suggest me something?

Thank you

Ottavio

-- 
Non c'e' piu' forza nella normalita', c'e' solo monotonia

Responses

psycopg by date

Next:From: Federico Di GregorioDate: 2012-01-05 10:40:23
Subject: Re: Storing file in postgresql and accessing them with psycopg
Previous:From: Peter IrbizonDate: 2012-01-01 23:01:04
Subject: Re: cannot install psycopg2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group