Questions tagged [postgresql-9.1]

for PostgreSQL questions specific to version 9.1.

PostgreSQL 9.1 is the version of PostgreSQL released in September of 2011, with expected end-of-life in September of 2016.

While the generic tag should probably be used with all PostgreSQL-related questions, this tag should also be used if the question pertains to features added in version 9.1, or if the question is about a problem seen while running version 9.1.

1821 questions
113
votes
1 answer

how to move tables from public to other schema in Postgres

Postgres 9.1 database contains tables yksus1 .. ykssu9 in public schema. pgAdmin shows those definitions as in code below. How to move those tables to firma1 schema ? Other tables in firma1 schema have foreign key references to those table primay…
Andrus
  • 26,339
  • 60
  • 204
  • 378
112
votes
2 answers

How to Disconnect from a database and go back to the default database in PostgreSQL?

I'm using PostgreSql version : postgres=# select version(); version ------------------------------------------------------------- PostgreSQL 9.2.4, compiled by Visual C++ build 1600, 64-bit (1 row) i had connected to a…
09Q71AO534
  • 4,300
  • 13
  • 44
  • 68
101
votes
4 answers

Postgresql: ERROR: type "citext" does not exist

I have read other posts, when searching, an answer to this question. I am using PostgreSQL 9.1, and created extension 'citext' using CREATE EXTENSION citext, but when I try to create any columns of type 'citext', it throws this error ERROR: type…
NullException
  • 4,232
  • 8
  • 24
  • 44
99
votes
16 answers

Rails 3 - can't install pg gem

When I try to run bundle (bundle install), I all the time get Installing pg (0.13.2) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/bin/ruby…
user984621
  • 46,344
  • 73
  • 224
  • 412
94
votes
7 answers

Strange PostgreSQL "value too long for type character varying(500)"

I have a Postgres schema which looks like: The problem is that whenever I save text longer than 500 characters in the description column I get the error: value too long for type character varying(500) In the documentation for Postgres it says type…
Parham
  • 1,302
  • 1
  • 12
  • 19
92
votes
1 answer

Failed to find conversion function from unknown to text

In one of my select statements I've got the following error: ERROR: failed to find conversion function from unknown to text ********** Error ********** ERROR: failed to find conversion function from unknown to text SQL state: XX000 This was easy…
Tomas Greif
  • 21,685
  • 23
  • 106
  • 155
91
votes
6 answers

cannot create extension without superuser role

I'm trying to run unit tests in Django, and it creates a new database. The database has postgis extensions and when I regularly create the database, I use "CREATE ExTENSION postgis". However, when I run tests, it gives me the following error: $…
user9903
91
votes
6 answers

postgres, ubuntu how to restart service on startup? get stuck on clustering after instance reboot

I have a Postgres db 9.1 running on AWS EC2, with ubuntu 12.04. I messed a lot with the instance (i.e installed all kinds of postgres X.X before i settled on 9.1). Now after a month working on that db, I discovered that if I restart my instance…
yaron
  • 1,283
  • 1
  • 11
  • 21
89
votes
7 answers

How do I import modules or install extensions in PostgreSQL 9.1+?

Firstly, if you're not using 9.1+, please refer to this question. How do I install an extension to PostgreSQL 9.1?
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
85
votes
6 answers

Postgresql SQL: How check boolean field with null and True,False Value?

In my database table I am having one boolean column, which have some rows with False, True and Null. These are the cases I have tried: Case 1: select * from table_name where boolean_column is null; works well. Give the result with all rows having…
Anil Kesariya
  • 1,044
  • 1
  • 7
  • 13
85
votes
2 answers

How to invoke sequence while inserting new record into postgresql table?

How do I invoke a postgresql sequence while inserting new row into a table? I want to do something like this: insert into biz_term( biz_term_id, biz_term_name, ) values(SELECT nextval(idsequence)', 'temp' ); I want to do it because when I…
Rajesh
  • 2,934
  • 8
  • 42
  • 71
78
votes
3 answers

PostgreSQL field type for unix timestamp?

PostgreSQL field type for unix timestamp : to store it as unix time stamp to retrieve it as a unix timestamp as well. Have been going through Date/Time Types postgreSQL V 9.1. Is integer the best way to go!? (this is what I had done when I was…
ThinkingMonkey
  • 12,539
  • 13
  • 57
  • 81
77
votes
4 answers

Postgresql Database export to .sql file

I want to export my database as a .sql file. Can someone help me? The solutions I have found don't work. A detailed description please. On Windows 7.
moxmlb
  • 1,190
  • 3
  • 10
  • 18
77
votes
2 answers

What's a PostgreSQL "Cluster" and how do I create one?

I am very new to databases, I haven't worked lot on it. Now I want to understand the term database clusters. I googled a lot and found many useful links but I am not able to understand them - maybe because I have very little basic knowledge about…
Sunil Kumar
  • 1,349
  • 3
  • 14
  • 25
77
votes
3 answers

PostgreSQL date() with timezone

I'm having an issue selecting dates properly from Postgres - they are being stored in UTC, but not converting with the Date() function properly. Converting the timestamp to a date gives me the wrong date if it's past 4pm PST. 2012-06-21 should be…