Re: Execute A String of Query

Поиск
Список
Период
Сортировка
От Nick Fankhauser
Тема Re: Execute A String of Query
Дата
Msg-id NEBBLAAHGLEEPCGOBHDGAENGEDAA.nickf@ontko.com
обсуждение исходный текст
Ответ на Execute A String of Query  ("lonh SENG" <slonh@camgsm.com.kh>)
Список 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 по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Execute A String of Query
Следующее
От: Jodi Kanter
Дата:
Сообщение: sub selects