Re: Selectively Importing Data

Поиск
Список
Период
Сортировка
От Andy Colson
Тема Re: Selectively Importing Data
Дата
Msg-id 563432BC.2070409@squeakycode.net
обсуждение исходный текст
Ответ на Selectively Importing Data  (David Blomstrom <david.blomstrom@gmail.com>)
Список pgsql-general
On 10/30/2015 07:24 PM, David Blomstrom wrote:
> First consider the following table:
>
> create table taxon (
>    taxonid serial,
>    descr text
> );
>
> As I understand it, "serial" means that column will automatically populate with a numerical key.
>
> If I want to fill the field 'descr' with a list of scientific names stored in a spreadsheet, then how would I
proceed?
>
> I have a spreadsheet that has about a dozen columns. I copied the field with scientific names into a new spreadsheet.
ThenI created an empty field on the left. So I have a spreadsheet with two columns. I saved it as a CSV file. 
>
> When I try to import it with pgAdmin III, I get the error message
>
> WARNING: null value in column "taxonid" violates non-null constraint
>
> How can I import that single column into the second column in this table? Thanks.

Try using just one column?

Or, create taxonid as integer, then fill the spreadsheet column with int's, and import both columns.

-Andy


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Upgrade from 9.3 to 9.4 issue
Следующее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Selectively Importing Data