RE: RE: VARCHAR to CIDR type cast

Поиск
Список
Период
Сортировка
От Alex Pilosov
Тема RE: RE: VARCHAR to CIDR type cast
Дата
Msg-id Pine.BSO.4.10.10106111347040.16686-100000@spider.pilosoft.com
обсуждение исходный текст
Ответ на RE: RE: VARCHAR to CIDR type cast  (Nicolas Huillard <nhuillard@ghs.fr>)
Список pgsql-general
I'm writing these functions right now...Tonight i'll submit this to this
group :)

On Mon, 11 Jun 2001, Nicolas Huillard wrote:

> That's what I'm planning...
> But I have not such function code to start with. Is there somewhere
> something like that :
> * a simple C function with all the PostgreSQL stuff
> * that simply call a PG's internal function (that will be cidr_in and
> inet_in, for me)
>
> >
> > Unfortunately, you cannot use inet_in function to cast a varchar, since
> it
> > expects as input slightly different data (a null-terminated string),
> > while varchar is different (it has length info in beginning). I remember
> > there was a discussion about creation of a 'cstring' datatype to support
> > such conversions (ie convert xxx to yyy via xxx_out and yyy_in), but I
> > don't see any result...Anyone?
>
> OK : the external cast function will only convert the
> "length-info-at-the-beginning" string into a "null-terminated" string, then
> call cidr_in...
> Really simple, in fact, but with a lot of stuff all around, isn't it ?
>
> NH
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>



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

Предыдущее
От: Nicolas Huillard
Дата:
Сообщение: RE: RE: VARCHAR to CIDR type cast
Следующее
От: The Hermit Hacker
Дата:
Сообщение: sysauth-pgsql / pam-pgsql port(s) ...