Re: inet increment with int

Поиск
Список
Период
Сортировка
От Patrick Welche
Тема Re: inet increment with int
Дата
Msg-id 20050906121250.GB560@quartz.itdept.newn.cam.ac.uk
обсуждение исходный текст
Ответ на Re: inet increment with int  (Patrick Welche <prlw1@newn.cam.ac.uk>)
Список pgsql-hackers
On Mon, Sep 05, 2005 at 08:10:16PM +0100, Patrick Welche wrote:
> On Mon, Sep 05, 2005 at 03:02:55PM -0400, Tom Lane wrote:
> > Patrick Welche <prlw1@newn.cam.ac.uk> writes:
> > > * Allow INET + INT4 to increment the host part of the address, or
> > >   throw an error on overflow
> >
> > > I think that the naively coded function attached does what is needed, e.g.,
> >
> > What happened to the IPv6 case?
>
> My take on the thread is that the IPv6 case doesn't make sense, and the
> int8 part was dropped from the TODO.
>
> > Also, I think you need to reject CIDR inputs.
>
> OK

Now with:

test=# select '192.168.0.0/24'::inet + 1;
ERROR:  Trying to increment a network (192.168.0.0/24) rather than a host
test=# select '192.168.0.1/24'::inet + -1;
ERROR:  Increment returns a network (192.168.0.0/24) rather than a host

Cheers,

Patrick

Вложения

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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: statement logging / extended query protocol issues
Следующее
От: nathan wagner
Дата:
Сообщение: uuid type for postgres