inet Operator Does not exists

--001485e8ac0698b41f048619bc90
Content-Type: text/plain; charset=ISO-8859-1

Hello Team,

I am facing an issue with inet .

Locally i am using postgresql 8.3 and for remote server i am using 8.1

CREATE FUNCTION inet_to_bigint(inet) RETURNS bigint AS $$
SELECT $1 - inet '0.0.0.0'
$$ LANGUAGE SQL;


Now above querry works fine for 8.3 but not for 8.1. I was wondering if
there is some thing wrong from my side.

Below is the error message

ERROR: operator does not exist: inet - inet
HINT: No operator matches the given name and argument type(s). You
may need to add explicit type casts.
CONTEXT: SQL function "inet_to_bigint"


--
Best Regards
Shakeel Abbas

--001485e8ac0698b41f048619bc90
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello Team,<div><br></div><div>I am facing an issue with inet .=A0</div><di=
v><br></div><div>Locally i am using postgresql 8.3 and for remote server i =
am using 8.1</div><div><span class=3D"Apple-style-span" style=3D"font-famil=
y: arial, tahoma, verdana, helvetica, sans-serif, serif; font-size: 13px; -=
webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px=
; "><pre class=3D"data" style=3D"font-size: 13px; font-family: arial, tahom=
a, verdana, helvetica, sans-serif, serif; ">
CREATE FUNCTION inet_to_bigint(inet) RETURNS bigint AS $$
SELECT $1 - inet '0.0.0.0'
$$ LANGUAGE SQL;</pre></span></div><div><br></div><div>Now above querry wor=
ks fine for 8.3 but not for 8.1. =A0I was wondering if there is some thing =
wrong from my side.</div><div><br></div><div>Below is the error message</di=
v>
<div><br></div><div><span class=3D"Apple-style-span" style=3D"font-family: =
arial, tahoma, verdana, helvetica, sans-serif, serif; font-size: 13px; -web=
kit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "=
><pre class=3D"data" style=3D"font-size: 13px; font-family: arial, tahoma, =
verdana, helvetica, sans-serif, serif; ">
ERROR: operator does not exist: inet - inet
HINT: No operator matches the given name and argument type(s). You may nee=
d to add explicit type casts.
CONTEXT: SQL function "inet_to_bigint"</pre></span></div><div>=
=A0</div><div>-- <br>Best Regards<br>Shakeel Abbas<br><br>
</div>

--001485e8ac0698b41f048619bc90--
ABBAS SHAKEEL [ Sa, 08 Mai 2010 20:56 ] [ ID #2041097 ]

Re: inet Operator Does not exists

ABBAS SHAKEEL <shakeel.abbas.qau [at] gmail.com> writes:
> CREATE FUNCTION inet_to_bigint(inet) RETURNS bigint AS $$
> SELECT $1 - inet '0.0.0.0'
> $$ LANGUAGE SQL;

> Now above querry works fine for 8.3 but not for 8.1. I was wondering if
> there is some thing wrong from my side.

Per the 8.2 release notes:

* Add convenient arithmetic operations on INET/CIDR values (Stephen R. van den Berg)

The new operators are & (and), | (or), ~ (not), inet + int8, inet - int8, and inet - inet.

regards, tom lane

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Tom Lane [ So, 09 Mai 2010 02:44 ] [ ID #2041133 ]
Datenbanken » gmane.comp.db.postgresql.admin » inet Operator Does not exists

Vorheriges Thema: List traffic
Nächstes Thema: Invitation to connect on LinkedIn