RE: RE: VARCHAR to CIDR type cast - Mailing list pgsql-general

From Alex Pilosov
Subject RE: RE: VARCHAR to CIDR type cast
Date
Msg-id Pine.BSO.4.10.10106111347040.16686-100000@spider.pilosoft.com
Whole thread Raw
In response to RE: RE: VARCHAR to CIDR type cast  (Nicolas Huillard <nhuillard@ghs.fr>)
List 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 by date:

Previous
From: Nicolas Huillard
Date:
Subject: RE: RE: VARCHAR to CIDR type cast
Next
From: The Hermit Hacker
Date:
Subject: sysauth-pgsql / pam-pgsql port(s) ...