Using file data as argument to functions called from psql command line

From: Mazen Abdel-Rahman <saba(dot)mazen(at)gmail(dot)com>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Using file data as argument to functions called from psql command line
Date: 2009-11-19 04:14:42
Message-ID: 92265adf0911182014u1b909f9clded13efe547f7e7e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

Is it possible possible to use a file's data as an argument to one of
PostgreSQL's functions via the psql command line?

For example - I know I can do this:

select xpath('/bookstore/book','<?xml version="1.0"
encoding="ISO-8859-1"?><bookstore><book><title lang="eng">Harry
Potter</title><price>29.99</price></book></bookstore>')

Is it possible to read a file to be the second argument in this function?
(For example books.xml).

Thank You!
Mazen Abdel-Rahman

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Thom Brown 2009-11-19 10:44:14 Re: Using file data as argument to functions called from psql command line
Previous Message Steve Crawford 2009-11-19 01:13:05 Re: Padding time values from EXTRACT()