Re: keeping images in a bytea field on AWS RDS

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Richard Bernstein <richb201(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: keeping images in a bytea field on AWS RDS
Date: 2020-03-31 19:51:48
Message-ID: 4F206EC1-7336-4621-ACF8-5498754941F0@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Mar 31, 2020, at 12:49, Richard Bernstein <richb201(at)gmail(dot)com> wrote:
>
> I am using postgresql on RDS. I need to upload an image to the table. I understand that I need to set the PGDATA directory and place the image file in it, before setting the path in the bytea field. But how do I set PGDATA if I don't have the ability to set an environment variable, and don't have access to the following on an AWS controlled installation?

No, that's not how you upload images to a bytea field; you use the standard client library and send the bytea data over that way. It works the same on community PostgreSQL and RDS. PostgreSQL handles managing the bytea data for you. Note that for very large binary objects, storing them in the database is not going to be very efficient versus keeping them in the filesystem (noting, of course, that you don't have access to the filesystem of an RDS server).

--
-- Christophe Pettus
xof(at)thebuild(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alan Hodgson 2020-03-31 20:48:41 Re: keeping images in a bytea field on AWS RDS
Previous Message Richard Bernstein 2020-03-31 19:49:11 keeping images in a bytea field on AWS RDS