Query RE using COPY

Поиск
Список
Период
Сортировка
От Paul Lambert
Тема Query RE using COPY
Дата
Msg-id 463FD7B8.9030700@autoledgers.com.au
обсуждение исходный текст
Ответы Re: Query RE using COPY  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Список pgsql-sql
I use the COPY command to load data from a file into tables in my database.

The following is an example done in psql:COPY deals_temp_load FROM 'c:/temp/autodrs_deals.txt' WITH DELIMITER AS 
'^' QUOTE '\f' CSV HEADER;

If a column is added to the table but has not been added to the extracts 
which create the autodrs_deals.txt file, this errors thusly:
ERROR:  missing data for column "location"
CONTEXT:  COPY deals_temp_load, line 2: "line containing data removed 
for confidentiality - suffice to say it does not contain the 'location' 
column"

Is there any way of telling it to ignore columns that have not been 
specified in the file used to load? I have tried giving the column a 
default value but I still get the error. The column in this case 
'location' is a nullable column and does not always have data (yes, bad 
design for a database, but we'll skip that point for now) thus I am not 
concerned if the load procedure doesn't supply it.

BTW, this is done on Weendoze.

Thanks,
Paul.

-- 
Paul Lambert
Database Administrator
AutoLedgers



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Error: Input string was not in a correct format
Следующее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: Query RE using COPY