Re: Problem using IP functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marc Lamothe" <mlamothe(at)openface(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Problem using IP functions
Date: 2001-05-13 03:44:24
Message-ID: 22976.989725464@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Marc Lamothe" <mlamothe(at)openface(dot)ca> writes:
> The subnet_number column is a varchar(16) which I assume you can compare
> with a text data type, which is what host() returns.

Are you on a pre-7.1 Postgres release? host() is buggy before 7.1 ---
it includes a trailing null in its output, which it shouldn't oughta
have done. You can't see the null from outside the system, but it
manages to mess up text comparisons anyway.

BTW, you should consider using inet or cidr datatype for that column
rather than varchar...

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message rmcm 2001-05-13 08:05:41 Re: Re: Informix->PostgreSQL database convertion
Previous Message Tom Lane 2001-05-13 03:03:56 Re: SELECT timestamp('2001-06-12'::date - '2000-06-12'::date)