Re: Weird NULL behavior
От | Stephan Szabo |
---|---|
Тема | Re: Weird NULL behavior |
Дата | |
Msg-id | 20021107083423.A97075-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | Weird NULL behavior (Ludwig Lim <lud_nowhere_man@yahoo.com>) |
Ответы |
Re: Weird NULL behavior
|
Список | pgsql-sql |
On Thu, 7 Nov 2002, Ludwig Lim wrote: > Hi: > > Has anyone encountered this before? > SELECT CAST ( (NULL*NULL) AS NUMERIC(2,0)); > > > returns the following error message: > Cannot cast type '"char"' to '"numeric"' It seems to me that it's trying to decide on a type for the expression NULL * NULL. It's a NULL, but a NULL of what type? I think the spec gets around this by disallowing such structures AFAIK (NULL can be used in like row value constructors, case and cast). I think the "sql" way of doing the above would be select cast(cast(NULL as NUMERIC(2,0))*cast(NULL as NUMERIC(2,0))as NUMERIC(2,0));
В списке pgsql-sql по дате отправления: