Re: Bad behaviour on some geometric operations on degenerate polygons

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Bad behaviour on some geometric operations on degenerate polygons
Дата
Msg-id 20140215050720.GE15047@momjian.us
обсуждение исходный текст
Ответ на Re: Bad behaviour on some geometric operations on degenerate polygons  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Bad behaviour on some geometric operations on degenerate polygons  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
On Sat, Feb 15, 2014 at 12:00:09AM -0500, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > What is odd however, is that we allow _explicit_ creation of zero-radius
> > circles:
>
> >     test=> SELECT circle '<(1,1),0>';
> >       circle
> >     -----------
> >      <(1,1),0>
> >     (1 row)
>
> > so why do we prevent the conversion of single-point polygons to circles
> > with zero radius?  I don't know.
>
> Maybe we should rethink that.  What you've done here seems like a kluge.

Yes, it would be much easier to allow the zero-radius circles.  The
attached smaller patch allows all the cases to work:

    test=> SELECT @@ polygon '((1, 1))';
     ?column?
    ----------
     (1,1)
    (1 row)

    test=> SELECT point(polygon '((1, 1))');
     point
    -------
     (1,1)
    (1 row)

    test=> SELECT circle(polygon '((1, 1))');
      circle
    -----------
     <(1,1),0>
    (1 row)

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bad behaviour on some geometric operations on degenerate polygons
Следующее
От: Clemens Eisserer
Дата:
Сообщение: Re: BUG #9161: wal_writer_delay is limited to 10s