Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux