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

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Selecting newly added column returns empty but only when selecting with other columns in table
Date: 2015-11-27 03:25:37
Message-ID: 5657CD31.6070208@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2015-11-27 03:26:13 Re: Selecting newly added column returns empty but only when selecting with other columns in table
Previous Message Melvin Davidson 2015-11-27 03:24:55 Re: Selecting newly added column returns empty but only when selecting with other columns in table