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

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: mrtruji <mrtruji(at)gmail(dot)com>, 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 02:43:01
Message-ID: 5657C335.80801@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/26/2015 04:13 PM, mrtruji wrote:
> Just added a new bytea type column to an existing psql table and
> populated the column entirely with row data. Running into some strange
> query results:
>
> When I select the newly added column by itself I get all the data as
> expected:
>
> |SELECT new_col FROM data LIMIT 1; Result: \x8481e7dec3650040b.... |
>
> When I try to filter with 'where' on another column in the table, I get
> the values from the other columns as expected but empty from my new_column:
>
> |SELECT id, state, new_col FROM data WHERE state='CA' limit 1; Result:
> 123456_1; CA; EMPTY ROW |

I am not following the above.

What does EMPTY ROW mean when referring to a column?

>
> The reverse is also true. If I select my new column in combination with
> other columns with no 'where' I get the correct value from my new column
> but empty for the other columns:
>
> |SELECT id, state, new_col FROM data limit 1; Result: EMPTY ROW; EMPTY
> ROW; \x8481e7dec3650040b....|

The same above, or do you mean EMPTY COLUMN?

Where are you getting the above results, in psql, your Python program or
somewhere else?

Assuming new_col refers to features_bin in your later post, correct?

>
> Thanks to anyone with advice!
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-11-27 02:46:07 Re: Selecting newly added column returns empty but only when selecting with other columns in table
Previous Message Melvin Davidson 2015-11-27 02:35:56 Re: Selecting newly added column returns empty but only when selecting with other columns in table