Skip site navigation (1) Skip section navigation (2)

Send parameters using Shell script to PostgreSQL

From: wolfang <wolfang83(at)hotmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Send parameters using Shell script to PostgreSQL
Date: 2010-12-27 19:41:48
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

I'm new using PostgreSQL, and I trying to run a script of shell where I can
send parameters to a sentence COPY but always returned an error.

This is my sentence in SHELL, where insertar_usuario_archivo.sql contain
this sentence SQL: \COPY T_SADCDMA_USUARIO_AAA from :v_archivo WITH

and   file.cargar contain only the data who I whant put inside the BD whith
the delimiter "|".

$postgrelhome/bin/64/psql -w -h -p 5432 -U aprn_des -f
/export/home/sso/LOADER_SADCDMA/insertar_usuario_archivo.sql -v
v_archivo='/export/home/sso/LOADER_SADCDMA/file.cargar' -d  PGSQL_DES

This is the error that returned me when I run the sentence:

:v_archivo: No such file or directory

View this message in context:
Sent from the PostgreSQL - novice mailing list archive at


pgsql-novice by date

Next:From: YAMAMOTO TakashiDate: 2010-12-28 05:08:05
Subject: batching commands with libpq
Previous:From: Dave PageDate: 2010-12-27 19:10:19
Subject: Re: COPY from PGAdmin

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group