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

  • SEARCH
  • Home
  • 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 8252879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:41:04+00:00 2026-06-08T00:41:04+00:00

Recently I went into trouble trying to use hstore with Django. I installed hstore

  • 0

Recently I went into trouble trying to use hstore with Django. I installed hstore this way:

$ sudo -u postgres psql
postgres=# CREATE EXTENSION hstore;
WARNING:  => is deprecated as an operator name
DETAIL:  This name may be disallowed altogether in future versions of PostgreSQL.
CREATE EXTENSION
postgres=# \dx
                           List of installed extensions
  Name   | Version |   Schema   |                   Description                    
---------+---------+------------+--------------------------------------------------
 hstore  | 1.0     | public     | data type for storing sets of (key, value) pairs
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)

And naively thought that my new databases would include hstore. That ain’t the case:

$ createdb dbtest
$ psql -d dbtest -c '\dx'
                 List of installed extensions
  Name   | Version |   Schema   |         Description          
---------+---------+------------+------------------------------
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
(1 row)

Is there a way to automatically have hstore in a newly created database ?

  • 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-08T00:41:05+00:00Added an answer on June 8, 2026 at 12:41 am

    Long story short:

    Install hstore in the template1 database:

    psql -d template1 -c 'create extension hstore;'
    

    Step-by-step explanation:

    As stated by the PostgreSQL documentation:

    CREATE EXTENSION loads a new extension into the current database.

    Installing an extension is database-specific. The following returns you the current database name:

    $ psql -c 'select current_database()'
     current_database 
    ------------------
     username
    (1 row)
    

    In case you have a database named after your username. Now with dbtest:

    $ psql -d dbtest -c 'select current_database()'
     current_database 
    ------------------
     dbtest
    (1 row)
    

    Ok, you got it. Now, to create new databases with hstore installed, you’ll have to install it in the template1 database. According to the doc:

    CREATE DATABASE actually works by copying an existing database. By default, it copies the standard system database named template1.

    Let’s do this:

    $ psql -d template1 -c 'create extension hstore;'
    

    And check that it works :

    $ createdb dbtest
    $ psql -d dbtest -c '\dx'
                     List of installed extensions
      Name   | Version |   Schema   |                   Description                    
    ---------+---------+------------+--------------------------------------------------
     hstore  | 1.0     | public     | data type for storing sets of (key, value) pairs
     plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
    (2 rows)
    

    Done!

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

Sidebar

Related Questions

I'm trying to create this simple game but I'm having trouble. Here's the code,
We recently went into private beta on our flagship product and had a small
I recently gave up trying to use Scala in Eclipse (basic stuff like completion
I recently went from phpmyadmin 2.6 to 5.1, also installed wamp...I know long time
I've recently installed Juno EE Edition and am trying to get my Glassfish 3.1.2.2
I recently got into node and I installed it on my localhost. I am
I recently updated my Developer membership. My new contract went into effect May 19th.
I recently stumbled into this this C++/Lua error int function_for_lua( lua_State* L ) {
I recently attempted to use selenium RC's GetAttribute method but immediately ran into a
Okay, so recently I've been reading into ninject but I am having trouble understanding

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.