Re: Selecting newly added column returns empty but only when selecting with other columns in table

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Selecting newly added column returns empty but only when selecting with other columns in table
Дата
Msg-id 5657CD31.6070208@hogranch.com
обсуждение исходный текст
Ответ на Re: Selecting newly added column returns empty but only when selecting with other columns in table  (mrtruji <mrtruji@gmail.com>)
Список pgsql-general
On 11/26/2015 7:11 PM, mrtruji wrote:
> for x in features:
>    cur.execute('insert into data (features_bin) values (%s);',[x])
>    conn.commit()


yup, my guess was right.  you inserted new rows with the features_bin
field, but no other fields.

you want to use UPDATE, not INSERT, and you'd better have some way of
specifying which row you want each UPDATE to modify...  like...

     UPDATE data SET features_bin = %s WHERE id = ....;



--
john r pierce, recycling bits in santa cruz



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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Selecting newly added column returns empty but only when selecting with other columns in table
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: Selecting newly added column returns empty but only when selecting with other columns in table