pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: Ferrell, Denise D CTR NSWCDD, H11 <denise.ferrell.ctr@navy.mil>
To: pgsql-admin@postgresql.org
Subject: Re: Inserting .png file into bytea column
Date: Thu, 19 Nov 2015 16:19:02 +0200
Message-ID: <564DDA56.7030809@matrix.gatewaynet.com> (raw)
In-Reply-To: <2BC18916DE4BF141AC1EFC55CE2CAE7D111B8C62@NAEANRFKXM01V.nadsusea.nads.navy.mil>
References: <2BC18916DE4BF141AC1EFC55CE2CAE7D111B8C62@NAEANRFKXM01V.nadsusea.nads.navy.mil>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

On 19/11/2015 16:07, Ferrell, Denise D CTR NSWCDD, H11 wrote:
> Good Morning All,
>
> I am using PostgreSQL 9.3 on Linux Rehat...
>
> I'm trying to insert an image (.png format) into a table of flags.  I've tried the following but keep getting errors.
>
> CREATE TABLE FLAGS (country_code text, flag bytea);
>
> INSERT INTO flags VALUES ('AD', pg_read_file('/home/flags')::bytea);
>
> Get the following error:
> ERROR:   absolute path not allowed
> *********ERROR*************
> ERROR:  absolute path not allowed
> SQL State:  42501
>
> Any assistance would be greatly appreciated.

http://www.postgresql.org/docs/9.2/static/functions-admin.html#FUNCTIONS-ADMIN-GENFILE

use |pg_read_binary_file(filename text [, offset bigint, length bigint])| as documented

>
> Denise Ferrell


-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

view thread (6+ messages)  latest in thread

Message-ID: <564DDA56.7030809@matrix.gatewaynet.com>
Permalink:  ../564DDA56.7030809@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/564DDA56.7030809@matrix.gatewaynet.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: achill@matrix.gatewaynet.com, denise.ferrell.ctr@navy.mil
  Subject: Re: Inserting .png file into bytea column
  In-Reply-To: <564DDA56.7030809@matrix.gatewaynet.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