From: Christophe Pettus <xof@thebuild.com>
To: Richard Bernstein <richb201@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: keeping images in a bytea field on AWS RDS
Date: Tue, 31 Mar 2020 12:51:48 -0700
Message-ID: <4F206EC1-7336-4621-ACF8-5498754941F0@thebuild.com> (raw)
In-Reply-To: <CAKXm1c3nJZLMZ8BNN7Aa+cB2mXED1BC2T-D-hePnMZToHh-NKQ@mail.gmail.com>
References: <CAKXm1c3nJZLMZ8BNN7Aa+cB2mXED1BC2T-D-hePnMZToHh-NKQ@mail.gmail.com>
> On Mar 31, 2020, at 12:49, Richard Bernstein <richb201@gmail.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@thebuild.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: xof@thebuild.com, richb201@gmail.com
Subject: Re: keeping images in a bytea field on AWS RDS
In-Reply-To: <4F206EC1-7336-4621-ACF8-5498754941F0@thebuild.com>
References: <CAKXm1c3nJZLMZ8BNN7Aa+cB2mXED1BC2T-D-hePnMZToHh-NKQ@mail.gmail.com> <4F206EC1-7336-4621-ACF8-5498754941F0@thebuild.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox