title: PostgreSQL - Unable to create table - data type point has no default operator class for access method "btree"
body: <p>so I'm working on a project to learn SQL, Python, and some server-side stuff and I'm pretty stumped at this point, after much searching. I want to create two identical tables, and I have the following code:</p>
  
  <pre><code>import psycopg2 as db
  import json
  
  with open('config.json', 'r') as f:
  config = json.load(f)
  
  conn = db.connect(user=config['dbuser'], database=config['dbname'], host=config['dbhost'], password=config['dbpass']);
  cur = conn.cursor()
  
  cur.execute("""CREATE TABLE IF NOT EXISTS A 
      (
              city            TEXT,
              location        POINT NOT NULL,
              eta             INTEGER,
              time            TIMESTAMP WITH TIME ZONE NOT NULL,
              holiday         BOOLEAN,
              PRIMARY KEY (location, time)
      );""")
  </code></pre>
  
  <p>and also table B, with the same format, where A and B are different services. When running this, I get:</p>
  
  <pre><code>Traceback (most recent call last):
    File "dbsetup.py", line 18, in &lt;module&gt;
  );""")
  psycopg2.ProgrammingError: data type point has no default operator class for access method "btree"
  HINT:  You must specify an operator class for the index or define a default operator class for the data type.
  </code></pre>
  
  <p>I've been searching for awhile now but nothing I'm coming across is very similar to this case, and I'm confused since surely I'm missing or mistaking something very basic here. Any help/pointing in the right direction would be much appreciated! General advice is very welcome too. </p>