COPY FROM - force a value

Поиск
Список
Период
Сортировка
От Demel, Jeff
Тема COPY FROM - force a value
Дата
Msg-id 136ED738BD4F1545B97E4AC06FF6370734C296@DMSP-MSG-EVS01.mail.pvt
обсуждение исходный текст
Ответы Re: COPY FROM - force a value  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-sql
Is there a way to force a value when you're doing a COPY FROM, importing
a file into a table?

Here's my query as it is now:

COPY filetable (value1, value2, value3, value4, forcevalue1,
forcevalue2)
FROM 'C:\\InsertFiles\\thisfile.txt'  WITH DELIMITER AS '    '
;

The file only contains data for values 1 through 4.  I'd like to insert
values for the last two fields.  This is what I had in mind, which
doesn't work:

COPY filetable (value1, value2, value3, value4, forcevalue1,
forcevalue2)
FROM 'C:\\InsertFiles\\thisfile.txt'  WITH DELIMITER AS '    ', forcevalue1 = 1, forcevalue2 = 'this value'
;

TIA

-Jeff
This email is intended only for the individual or entity to which it is addressed.  This email may contain information
thatis privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this
e-mailor any attachments by anyone other than the intended recipient, or an employee or agent responsible for
deliveringthe message to the intended recipient, is prohibited. If you are not the intended recipient of this message
orthe employee or agent responsible for delivery of this email to the intended recipient, please notify the sender by
replyingto this message and then delete it from your system.  Any use, dissemination, distribution, or reproduction of
thismessage by unintended recipients is strictly prohibited and may be unlawful. 


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

Предыдущее
От: "Ezequias Rodrigues da Rocha"
Дата:
Сообщение: Re: Open a Transaction
Следующее
От: "David Klugmann"
Дата:
Сообщение: unsubscribe