BUG #8513: Error recognizing data type in union

Поиск
Список
Период
Сортировка
От tommi.korhonen@thl.fi
Тема BUG #8513: Error recognizing data type in union
Дата
Msg-id E1VTt3W-000456-Ca@wrigleys.postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      8513
Logged by:          Tommi Korhonen
Email address:      tommi.korhonen@thl.fi
PostgreSQL version: 8.4.17
Operating system:   Redhat Linux
Description:

Example:


create table t1(a integer);
create table t2(b integer);
create table t3(c integer);


select null from t1
union all
select null from t2
union all
select c from t3;


produces an error


ERROR:  UNION types text and integer cannot be matched
LINE 5: select c from t3;


but


select null from t2
union all
select c from t3;


works correctly.


So it seems that if there are more than one nulls before field c in union
PostreSQL thinks merged field's data type is text.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Dhiraj Chawla
Дата:
Сообщение: Getting "getsockopt(TCP_KEEPALIVE) failed" LOG message in PG Logs on Solaris 10
Следующее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: BUG #8500: Upgrade to postgis 2.1 breaks existing databases