it will sound crazy, but I made one system that stores PNG pictures too! But unfortunately using MySQL and not Postgres, but I've read a little the documentation of Postgres and kinda realised that BLOB (Binary Large OBject) that I was using in MySQL exists also in Postgres, but the problem is in dumping the BLOB data in Postgres for backup purposes. There is just no way to dump it, the only thing to do is to go to the directory where database files are stored and to copy them! So .. its just a suggestion, but you should consider moving to MySQL because of the speed and stability. May be Postgres is Object-Relational Data Base System and have much more possibilities, but MySQL is moving toward it and will not sacrifice the speed .. well, that is what they say anyway. My friend Evgeny (aka Geniek) told me of a way to store the whole image from disk to a variable in a zip, and then you can insert that variable's content in a table:
open PIC "/dir_to_pic/picture";
undef $/; # by default the new line '\n'
my $picture = <PIC>;
$/="\n"; # should return it after
like this the whole picture is stored in scalar variable! But if there were new line character in $/ the content of picture would be stored just to the first new line character.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|