| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: Insert/select union bug |
| Дата | |
| Msg-id | 20060927095754.GA13693@svana.org обсуждение исходный текст |
| Ответ на | Insert/select union bug (Peter <peter@greatnowhere.com>) |
| Ответы |
Re: Insert/select union bug
|
| Список | pgsql-general |
On Wed, Sep 27, 2006 at 12:14:44PM +0300, Peter wrote: > create table temp(a timestamptz); > > insert into temp(a) select NULL; /* this passes */ > > insert into temp(a) select NULL union select NULL; /* fails: > ERROR: column "a" is of type timestamp with time zone but expression is > of type text > */ Perhaps you could indicate in the subselects the type? For example: insert into temp(a) select NULL::timestamptz union select NULL; I think as long as the first has the right type, you're set. BTW, UNION ALL is probably more efficient. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера