Re: Execute A String of Query - Mailing list pgsql-admin

From Nick Fankhauser
Subject Re: Execute A String of Query
Date
Msg-id NEBBLAAHGLEEPCGOBHDGAENGEDAA.nickf@ontko.com
Whole thread Raw
In response to Execute A String of Query  ("lonh SENG" <slonh@camgsm.com.kh>)
List pgsql-admin
Lon-

>    My delimiter file is as following:
>
>uid|username
>----+---------
>2974|012801849

Assuming all of these values are integers, and the file is called
/home/lon/users.txt, this should work in psql:


create table user_stuff (id Int, name BigInt);
copy user_stuff from '/home/lon/test.txt' using delimiters '|';


The filename must be the full unix path, and you'll nee to remove any
headers or footers that don't contain data.
see this chunk of the manual for more details:

http://www.postgresql.org/idocs/index.php?sql-copy.html

-Nick

--------------------------------------------------------------------------
Nick Fankhauser  nickf@ontko.com  Phone 1.765.935.4283  Fax 1.765.962.9788
Ray Ontko & Co.     Software Consulting Services     http://www.ontko.com/


pgsql-admin by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Execute A String of Query
Next
From: Jodi Kanter
Date:
Subject: sub selects