Last active
October 19, 2017 16:43
-
-
Save activeshadow/2e14bf889d9d216713b6 to your computer and use it in GitHub Desktop.
PostgreSQL Errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE network_info ( | |
| network CIDR NOT NULL, | |
| some_info TEXT NULL, | |
| PRIMARY KEY (network) | |
| ); | |
| CREATE TABLE ipaddr_info ( | |
| ipaddr INET NOT NULL, | |
| some_info INT NULL, | |
| PRIMARY KEY (ipaddr, some_info) | |
| ); | |
| CREATE TABLE ipaddrs ( | |
| addr INET NOT NULL, | |
| ); | |
| CREATE VIEW ipaddr_summary AS | |
| SELECT DISTINCT | |
| i.addr AS ip_address, | |
| a.some_info AS network_info, | |
| COUNT(b.ipaddr) AS ip_info_count | |
| FROM ipaddrs AS i | |
| LEFT JOIN network_info AS a | |
| ON (i.addr << a.network) | |
| LEFT JOIN ipaddr_info AS b | |
| ON (i.addr = b.ipaddr) | |
| GROUP BY i.addr, a.some_info | |
| ; | |
| test_tbl=# CREATE INDEX idx_network_info_network_gist | |
| test_tbl-# ON network_info USING gist(network); | |
| ERROR: data type cidr has no default operator class for access method "gist" | |
| HINT: You must specify an operator class for the index or define a default operator class for the data type. | |
| test_tbl=# CREATE INDEX idx_ipaddr_info_ipaddr_gist | |
| test_tbl-# ON ipaddr_info USING gist(ipaddr); | |
| ERROR: data type inet has no default operator class for access method "gist" | |
| HINT: You must specify an operator class for the index or define a default operator class for the data type. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
inet_opsdid it. Thank you