Re: Query RE using COPY

Поиск
Список
Период
Сортировка
От Paul Lambert
Тема Re: Query RE using COPY
Дата
Msg-id 463FE405.40704@autoledgers.com.au
обсуждение исходный текст
Ответ на Re: Query RE using COPY  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Ответы Re: Query RE using COPY  ("Phillip Smith" <phillip.smith@weatherbeeta.com.au>)
Список pgsql-sql
Jonah H. Harris wrote:
> COPY mytbl (col1, col2, col3, col4, col6) FROM 'myfile.txt' WITH
> DELIMITER AS '^' QUOTE '\f' CSV HEADER;
> 
> 

I would rather not do it this way as I use the same load script at all 
customer sites where the extracts and requirements may vary. I.e. one 
customer may not use the location field mentioned above, but another might.

What I would prefer to do, if possible, is set that column in the 
database to 'not required' so that if I get an extract that doesn't have 
that column in the file, the copy doesn't care.

As it stands now I generally have to drop all the unneeded columns from  numerous tables, perform my load and then
re-addthem back again.
 

When we're talking about 40 or more tables in each database some tables 
with several hundred columns... your suggestion would be a bit 
cumbersome - particularly if it is only one or two columns in each table 
that that the client doesn't need.

-- 
Paul Lambert
Database Administrator
AutoLedgers



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: Query RE using COPY
Следующее
От: "Phillip Smith"
Дата:
Сообщение: Re: Query RE using COPY