Re: queries against CIDR fail against 8.0.3?

Поиск
Список
Период
Сортировка
От Russell Francis
Тема Re: queries against CIDR fail against 8.0.3?
Дата
Msg-id 433D8CA1.3050601@ev.net
обсуждение исходный текст
Ответ на Re: queries against CIDR fail against 8.0.3?  (Oliver Jowett <oliver@opencloud.com>)
Ответы Re: queries against CIDR fail against 8.0.3?
Список pgsql-jdbc
Oliver Jowett wrote:
> Russell Francis wrote:
>
> You will need to either create a PGobject subclass that returns the
> correct typename (cidr), or explicitly cast to cidr in your query:
>
> SELECT * FROM institution WHERE ( institution.network >>= ?::cidr )
> LIMIT 1
>
>
>>Does anyone have any ideas on how to address this issue?  Or at least an
>>explanation as to why it works in 7.3.9 but not 8.0.3?
>
>
> The 8.0 drivers type parameters more strongly than earlier drivers due
> to a change in the protocol used, so setObject(String) is passing the
> parameter explicitly as a 'text' value not as an untyped literal that
> gets implicitly casted to cidr. See the archives for more details.

Oliver & Kris,

Thanks much both of your responses were very helpful.  I have decided to
subclass PGobject to address the issue and have created a PGcidr class which
seems to be working well.

If there is any interest in adding this to the project, I would be happy
to submit what I have for review and also provide PGinet and PGmacaddr classes
to the core.

Thanks again,
Russ

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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: Intermittent I/O error?
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: queries against CIDR fail against 8.0.3?