Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8585819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:09:40+00:00 2026-06-11T22:09:40+00:00

I am trying to use PostgreSQL with the Seven Databases in Seven Weeks book.

  • 0

I am trying to use PostgreSQL with the “Seven Databases in Seven Weeks” book. I am using PostgreSQL 8.4.1 on an Ubuntu 10.04 server.

The first task is to create a database named “book” and check if the contrib packages have been installed properly.

$ createdb book
$ psql book -c "SELECT '1'::cube;"

When I do that I get the following output:

ERROR:  type "cube" does not exist
LINE 1: SELECT '1'::cube;

I already installed the cube package with the following command:

$ sudo -u postgres psql postgres < /usr/share/postgresql/8.4/contrib/cube.sql

I tried restarting PostgreSQL but the problem persists. When I tried running the package import a second time I got the following message, which explicitly states that type "cube" already exists:

SET
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
ERROR:  type "cube" already exists
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
ERROR:  operator < already exists
ERROR:  operator > already exists
ERROR:  operator <= already exists
ERROR:  operator >= already exists
ERROR:  operator && already exists
ERROR:  operator = already exists
ERROR:  operator <> already exists
ERROR:  operator @> already exists
ERROR:  operator <@ already exists
ERROR:  operator @ already exists
ERROR:  operator ~ already exists
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
ERROR:  operator class "cube_ops" for access method "btree" already exists
ERROR:  operator class "gist_cube_ops" for access method "gist" already exists

So, what am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:09:42+00:00Added an answer on June 11, 2026 at 10:09 pm

    You only installed the extension to your postgres database (the default system database named “postgres”) – which is probably not what you want. You need to install the extension to your database – once per database in which to use it.

    Or you can install it to a template database (template1 by default, but any database can be used as template) so that every new database created starts out with the functionality pre-installed.

    In PostgreSQL 8.4 or older, you need to run in the shell:

    psql -d dbname -f SHAREDIR/contrib/cube.sql

    Where dbname is the name of your actual target db. Or use the equivalent line that you have in your question.
    More info for PostgreSQL 8.4 in the manual here.

    Since PostgreSQL 9.1 this has been further simplified and you can just run in a database session:

    CREATE extension cube
    

    More in the manual here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use heroku db:push to upload my local postgresql database to the
I'm trying to use PostgreSQL as the database for Hibernate/JPA. However, I get an
I'm trying to use cayenne to interact with a PostgreSQL database. So far everything
Trying to recreate my SQL Server database on PostgreSQL. Everything is ok except I
I am trying to use Postgresql with Heroku. I installed Postgres 9.1.4 using the
Using Postgres, I'm trying to use AUTO_INCREMENT to number my primary key automatically in
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I'm trying to use PostgreSQL's RETURNING clause on an UPDATE within in UPDATE statement,
I am trying to use Heroku and apparently Postgresql is a lot more strict
I'm trying to use a SQL Array type with PostgreSQL 8.4 and the JDBC4

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.