Re: Inserting file content into column

From: Noel Faux <noel(dot)faux(at)med(dot)monash(dot)edu(dot)au>
To: Moravec Jan <Jan(dot)Moravec(at)ips-ag(dot)cz>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Inserting file content into column
Date: 2006-06-06 00:43:29
Message-ID: 4484CFB1.8070200@med.monash.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Moravec,

Look at the COPY command.

Cheers
Noel

Moravec Jan wrote:
> Hello,
>
> Is there a built-in function that reads the contents of a (textual) file which could then be inserted into a given (varchar) column. What I am after is something like:
>
> insert into cert ( cert_id,...., x509_data ) values ( nextval('seq_cert'), ...., load_file('./ca/mycert.pem') );
>
> I need to do that from a DB init SQL script rather then from an application.
>
> Thanks you,
> Jan Moravec
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Arnaud Lesauvage 2006-06-06 14:49:43 levenshtein contrib installation
Previous Message Moravec Jan 2006-06-06 00:05:02 Inserting file content into column