From: | Alex Pilosov <alex(at)pilosoft(dot)com> |
---|---|
To: | Nicolas Huillard <nhuillard(at)ghs(dot)fr> |
Cc: | "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org> |
Subject: | RE: RE: VARCHAR to CIDR type cast |
Date: | 2001-06-11 17:48:44 |
Message-ID: | Pine.BSO.4.10.10106111347040.16686-100000@spider.pilosoft.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tim Barnard | 2001-06-11 18:00:36 | Odd behavior with LIKE? |
Previous Message | The Hermit Hacker | 2001-06-11 17:42:13 | sysauth-pgsql / pam-pgsql port(s) ... |