Copy from and serial columns

Поиск
Список
Период
Сортировка
Искать

Copy from and serial columns

От:
Sean Davis <sdavis2@mail.nih.gov>
Дата:
I have a client (psycopg2) that only allows copies of the entire table 
(not specific rows).  I would like to use a SERIAL column on tables, but 
I cannot seem to figure out how to apply the default.  Trying to insert 
a NULL does not do it.  Is there another way, or should I do what is 
probably better and ask the client author to provide functionality for 
allowing subsets of columns to be passed to the copy command?

Thanks,
Sean

Re: Copy from and serial columns

От:
Sean Davis <sdavis2@mail.nih.gov>
Дата:
Sean Davis wrote:
> I have a client (psycopg2) that only allows copies of the entire table 
> (not specific rows).  I would like to use a SERIAL column on tables, 
> but I cannot seem to figure out how to apply the default.  Trying to 
> insert a NULL does not do it.  Is there another way, or should I do 
> what is probably better and ask the client author to provide 
> functionality for allowing subsets of columns to be passed to the copy 
> command?

Sorry.  psycopg2 has a "columns" argument that I was not aware of.  This 
will alleviate the problem.

Sean
FAQ