load sql from the file in postgresql

From: Sukuchha Shrestha <sukuchha(at)yahoo(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: load sql from the file in postgresql
Date: 2011-04-29 10:40:04
Message-ID: 442374.22491.qm@web29102.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hello group,

I just started to use postgresql and i want to import data using copy command in
a loop.

Here is what i did !

1) following content with name loaddata.sql.
\copy table from 'C:\psql\x.txt';
\copy table from 'C:\psql\y.txt';

2) My loaddata.sql is located in C:\psql\ therefore i tried to call the
loaddata.sql in psql like

\i C:\psql\loaddata.sql

But it says " C:: Permission denied"

What is a problem ? Please guide me ! Is there any better way to call copy
commad in a loop with varying filename!

regards
Sukuchha

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2011-04-29 10:42:08 Re: SSDs with Postgresql?
Previous Message Andres Freund 2011-04-29 08:25:02 Re: New feature: skip row locks when table is locked.