| From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
|---|---|
| To: | Kristian Larsson <kristian(at)spritelink(dot)net> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Adding integers ( > 8 bytes) to an inet |
| Date: | 2009-09-08 15:06:36 |
| Message-ID: | 20090908150636.GB549@alvh.no-ip.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general pgsql-hackers |
Kristian Larsson wrote:
> And poking in pg_operator / pg_type seems to confirm this:
>
> nils=# SELECT (SELECT typname FROM pg_type WHERE typelem=oprleft), oprname, (SELECT typname FROM pg_type WHERE typelem=oprright) FROM pg_operator WHERE oprleft=(SELECT typelem FROM pg_type WHERE typname='_inet') AND oprname='+';
> ?column? | oprname | ?column?
> ----------+---------+----------
> _inet | + | _int8
> (1 row)
That query is wrong -- type _inet is actually another way to spell
inet[]. What you want is this, that also confirms your problem:
alvherre=# SELECT oprleft::regtype, oprname, oprright::regtype, oprresult::regtype FROM pg_operator WHERE (oprleft='inet'::regtype OR oprright = 'inet'::regtype) AND oprname='+';
oprleft | oprname | oprright | oprresult
---------+---------+----------+-----------
inet | + | bigint | inet
bigint | + | inet | inet
(2 filas)
> Am I doing it the wrong way? Bug?
I'd say this is just a missing feature.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Sam Mason | 2009-09-08 15:31:40 | Re: How to store data on an external drive |
| Previous Message | Martin Gainty | 2009-09-08 14:41:37 | Re: Adding integers ( > 8 bytes) to an inet |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2009-09-08 15:31:40 | Re: More Snow Leopard fun: multiarch problems while building plperl |
| Previous Message | Martin Gainty | 2009-09-08 14:41:37 | Re: Adding integers ( > 8 bytes) to an inet |