Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
Op woensdag 13-02-2008 om 10:45 uur [tijdzone -0300], schreef Alvaro Herrera: > > Instead of base64 encoding, I guess it would be easier to just escape > > the required bytes and store them in a bytea. > Actually, if you have access to the pqExecParams() call, you can pass > the bytes to a bytea co

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
Op woensdag 13-02-2008 om 15:21 uur [tijdzone +], schreef Peter Wilson: > > Right, so that basically means that when 'large objects' are files, > > which should be saved and restored as a whole, it may be more natural to > > use the large objects. I guess that applies to some uses of media > >

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Wed, 2008-02-13 at 09:35 +, Peter Wilson wrote: > I've used both methods. The only real problem is that none of the > trigger based replication schemes > such as Slony can't deal with large objects. I can live with that for now. If the project ever gets that big, I probably need to rethink

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Wed, 2008-02-13 at 09:57 +0100, Gevik Babakhani wrote: > In hour case we where switching between databases so what I have done in the > past was: > For inserting: > 1. create a TEXT column in my table. (In PG this can be 1GB in size) > 2. read file contents in a buffer/string and Base64 encode

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Tue, 2008-02-12 at 21:14 -0600, Andy Colson wrote: > Having used the large objects, I can tell you they do backup (pg_dump, > etc) and they are not hard to use. There is even a contrib that helps > you hook them up to a table so they get deleted/etc at appropriate times > (I have not used it

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Tue, 2008-02-12 at 17:16 -0700, Leonel Nunez wrote: > > My two questions are: Is this summary correct? And: Which method should > > I choose? > With Java , Python , Perl you've got functions that escapes the data for > you What about C++ and PHP? Koen ---(end of bro

Re: [GENERAL] Storing images as BYTEA or large objects

2008-02-13 Thread Koen Vermeer
On Wed, 2008-02-13 at 07:37 +0100, Gevik Babakhani wrote: > Which programming language are you using? That would be C++ for storing and both C++ and PHP for retrieving the data. Maybe also PL/SQL for retrieval (in addition to or instead of PHP). Koen ---(end of broadcast

[GENERAL] Storing images as BYTEA or large objects

2008-02-12 Thread Koen Vermeer
Hi, I would like to store binary data in a PostgreSQL database. The size of the data is about 2 to 20 MB and is always stored or retrieved as a block (i.e., I do not need to get only part of the data). As I understand, I have two options for storing this data: As BYTEA or as large objects. As I un

Re: [GENERAL] Force SSL / username combination

2007-07-16 Thread Koen Vermeer
On Fri, 2007-07-13 at 06:53 -0400, Robert Treat wrote: > > Well if you do the popular technique of doing everything through stored > > procedures (in our case plpgsql functions) then you can have those > > functions check. I don't like that approach myself though. > Right. This approach always seem

[GENERAL] libpq: Specify pass phrase for SSL key

2007-07-12 Thread Koen Vermeer
Hi, I am using libpq to set up an SSL connection to a PostgreSQL server. The client key is protected by a pass phrase, so when I issue a PQconnectdb(), I get a prompt stating: Enter PEM pass phrase: Instead, I would like to give the user a nice message box, asking for his/her password. So, how d

Re: [GENERAL] Force SSL / username combination

2007-07-12 Thread Koen Vermeer
On Mon, 2007-07-09 at 09:05 +0200, Koen Vermeer wrote: > I want to set up a database server that is connected to the Internet. > Therefore, I want my users to use SSL/TLS certificates. I provide these > certificates to the users, so I can control the information that is in > there.

[GENERAL] Force SSL / username combination

2007-07-09 Thread Koen Vermeer
Hi, I want to set up a database server that is connected to the Internet. Therefore, I want my users to use SSL/TLS certificates. I provide these certificates to the users, so I can control the information that is in there. Now, I know that I can set up PostgreSQL to use SSL/TLS, but I am unable t