Re: Selecting newly added column returns empty but only when selecting with other columns in table - Mailing list pgsql-general

From John R Pierce
Subject Re: Selecting newly added column returns empty but only when selecting with other columns in table
Date
Msg-id 5657CD31.6070208@hogranch.com
Whole thread Raw
In response to Re: Selecting newly added column returns empty but only when selecting with other columns in table  (mrtruji <mrtruji@gmail.com>)
List 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 by date:

Previous
From: John R Pierce
Date:
Subject: Re: Selecting newly added column returns empty but only when selecting with other columns in table
Next
From: Melvin Davidson
Date:
Subject: Re: Selecting newly added column returns empty but only when selecting with other columns in table