Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.

In reply to Re: PostgreSQL and binary data by Alex the Serb
in thread PostgreSQL and binary data by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-28 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found