Обсуждение:

Поиск
Список
Период
Сортировка

От
dschmidt@lexmark.com
Дата:
Does anybody know how to detect a NULL in a geometric box type?

When I execute the following sql statement (coords is a box type)
autotest=# select coords from dlg_control limit 1
autotest-# \g
 coords
--------

(1 row)

So, I have data that contains a "NULL" in the coords column, but when I
test on box(NULL) I don't get any data...
autotest=# select coords from dlg_control where coords=box(NULL) limit 1
autotest-# \g
 coords
--------
(0 rows)

Any ideas?
Thanks,
Dennis





Re:

От
Stephan Szabo
Дата:
On Fri, 19 Sep 2003 dschmidt@lexmark.com wrote:

>
> Does anybody know how to detect a NULL in a geometric box type?
>
> When I execute the following sql statement (coords is a box type)
> autotest=# select coords from dlg_control limit 1

I'd guess you'd want
where dlg_control IS NULL

Re:

От
darren@crystalballinc.com
Дата:
oss=> create table test (id box null);

oss=> insert into test values ('1,1,1,1');
INSERT 9697510 1
oss=> insert into test values (NULL);
INSERT 9697511 1
oss=> select * from test;
     id
-------------
 (1,1),(1,1)

(2 rows)

oss=> select * from test where id is not null;
     id
-------------
 (1,1),(1,1)
(1 row)

oss=> select version();
                           version
-------------------------------------------------------------
 PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)

HTH
Darren


On Fri, 19 Sep 2003 dschmidt@lexmark.com wrote:

>
> Does anybody know how to detect a NULL in a geometric box type?
>
> When I execute the following sql statement (coords is a box type)
> autotest=# select coords from dlg_control limit 1
> autotest-# \g
>  coords
> --------
>
> (1 row)
>
> So, I have data that contains a "NULL" in the coords column, but when I
> test on box(NULL) I don't get any data...
> autotest=# select coords from dlg_control where coords=box(NULL) limit 1
> autotest-# \g
>  coords
> --------
> (0 rows)
>
> Any ideas?
> Thanks,
> Dennis
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>

--
Darren Ferguson


Re:

От
Doug McNaught
Дата:
dschmidt@lexmark.com writes:

> So, I have data that contains a "NULL" in the coords column, but when I
> test on box(NULL) I don't get any data...
> autotest=# select coords from dlg_control where coords=box(NULL) limit 1

You want to use 'coords IS NULL' here, just as for any other field
type.

-Doug