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
Дата
Msg-id
CANu8Fiwd3FmU4BJDmrBUb4HsdFBHTWVaReKFwJK2A4QJ4z-TUA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Selecting newly added column returns empty but only when selecting with other columns in table mrtruji <mrtruji@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table Adrian Klaver <adrian.klaver@aklaver.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table John R Pierce <pierce@hogranch.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table mrtruji <mrtruji@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table John R Pierce <pierce@hogranch.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table Melvin Davidson <melvin6925@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table mrtruji <mrtruji@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table Adrian Klaver <adrian.klaver@aklaver.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table mrtruji <mrtruji@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table Adrian Klaver <adrian.klaver@aklaver.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table mrtruji <mrtruji@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table John R Pierce <pierce@hogranch.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table Melvin Davidson <melvin6925@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table mrtruji <mrtruji@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table "David G. Johnston" <david.g.johnston@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table "David G. Johnston" <david.g.johnston@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table Melvin Davidson <melvin6925@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table mrtruji <mrtruji@gmail.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table Scott Mead <scottm@openscg.com>
Re: Selecting newly added column returns empty but only when selecting with other columns in table Melvin Davidson <melvin6925@gmail.com>
Is it possible you have more than one row where state = 'CA'? Putting a LIMIT 1 would then restrict to only 1 row.
Have you tried with no limit? IE: SELECT new_col FROM data;


On Thu, Nov 26, 2015 at 7:13 PM, mrtruji <mrtruji@gmail.com> 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

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....

Thanks to anyone with advice!




--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.
В списке pgsql-general по дате отправления
От: mrtruji
Дата:
От: mrtruji
Дата:
FAQ