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
13
votes
3 answers

How to disable foreign key constraints in postgresql

I'm using AWS Aurora Postgres and using DMS to migrate from RDS postgres to Aurora PG. In order to perform the FULL LOAD I want to disable foreign key constraints and triggers on all the objects. I'm able to disable triggers but couldn't find a way…
RMu
  • 817
  • 2
  • 17
  • 41
13
votes
1 answer

Join two select queries horizontally in Postgresql

I have following two queries: Query #1: (SELECT pl.c_project_Id, pl.c_projectphase_Id, pl.c_projecttask_Id, pl.m_product_Id, pj.name as projectname, ph.name as phasename, pt.name as taskname, pd.name as prodname, round(pl.plannedqty, 2)…
see2rizwan
  • 131
  • 2
  • 2
  • 9
13
votes
1 answer

Trigger vs. check constraint

I want to add a field-level validation on a table. There is a field named "account_number" and this field should always pass a "luhn" check. I've found a function called "luhn_verify" that seems to work properly (google for it if you are…
David S
  • 12,967
  • 12
  • 55
  • 93
13
votes
1 answer

Low Postgres Cache Hit Ratio - data size or something else?

I've just upgraded my Heroku postgres database from the Kappa plan (800MB RAM, postgres 9.1) to the Ronin plan (1.7GB RAM, postgres 9.2), but performance has degraded. Following the guide here, I checked and the cache hit rate is even lower than it…
13
votes
2 answers

Aggregate values over a range of hours, every hour

I have a PostgreSQL 9.1 database with a table containing a timestamp and a measuring value '2012-10-25 01:00' 2 '2012-10-25 02:00' 5 '2012-10-25 03:00' 12 '2012-10-25 04:00' 7 '2012-10-25 05:00' 1 ... ... I need to…
13
votes
7 answers

JPA Hibernate Call Postgres Function Void Return MappingException:

I have a problem where I am getting an: org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111 when trying to call a postgres function using JPA create native query. I created an EJB timer in a startup singleton to run a Postgres…
Bill Rosmus
  • 2,941
  • 7
  • 40
  • 61
13
votes
3 answers

Postgresql CITEXT Datatype Issue JPA Hibernate

I'm having difficulty using the CITEXT datatype in PostgreSQL using JPA and Hibernate. CITEXT is supposed to provide a case insensitive text datatype but when used with JPA/Hibernate it doesn't behave in a case insensitive manner. Has anyone else…
Bill Rosmus
  • 2,941
  • 7
  • 40
  • 61
13
votes
2 answers

No password prompt for postgresql superuser

After I installed PostgreSQL 9.1 on Ubuntu 12.04 I set the password for the "postgres" superuser account. I want all users to have to enter their password when loging in. This is why I configured pg_hba.conf like so: #Database administrative login…
Basil
  • 889
  • 2
  • 11
  • 27
13
votes
1 answer

Npgsql: Timeout while getting a connection from the pool

Background: I'm moving my application from mssql to npgsql v2.0.11.92. After a few minutes or hours of running my application, I get a System.Exception: Timeout while getting a connection from the pool. I'm using lib version 2.0.11.92 in x86…
Jochen
  • 380
  • 1
  • 3
  • 9
12
votes
2 answers

Java queries against PGPool II cause "unnamed prepared statement does not exist" errors

I have a Java app that uses a Postgres database and I'm trying to introduce PGPool in order to scale up my database. I'm running into a problem where Postgres throws the following error: unnamed prepared statement does not exist. After cranking up…
Mark B
  • 183,023
  • 24
  • 297
  • 295
12
votes
1 answer

Can the Postgres data type NUMERIC store signed values?

In PostgreSQL, I would like to store signed values -999.9 - 9999.9. Can I use numeric(5.1) for this? Or what type should I use?
Nyi Ma Lay Win Lae Aye
  • 6,250
  • 2
  • 13
  • 10
12
votes
3 answers

"PG::UndefinedTable: ERROR: relation does not exist" with a correct Rails naming and convention

I've read a lot of potsts like this, but all the solutions I've seen are in the nomenclature of the models, naming and Rails convention. Now I have this problem when I run for first time in production environment in PostgreSQL 9.1 rake…
Albert Català
  • 2,026
  • 2
  • 29
  • 35
12
votes
2 answers

Cannot connect to Postgres running on VM from host machine using MD5 method

I have a VM set up with Vagrant that has Postgres running on it (on port 5432), forwarded to port 8280 on the host machine. I have set the password for the default user and I can connect locally just fine. I have been trying to set up access from…
Hugo Rodger-Brown
  • 11,054
  • 11
  • 52
  • 78
12
votes
2 answers

Change varchar to boolean in PostgreSQL

I've started working on a project where there is a fairly large table (about 82,000,000 rows) that I think is very bloated. One of the fields is defined as: consistency character varying NOT NULL DEFAULT 'Y'::character varying It's used as a…
David S
  • 12,967
  • 12
  • 55
  • 93
12
votes
2 answers

What is going wrong with postgresql initdb? Why is the `UTF-8` encoding not getting enforced?

I am using PostgreSQL 9.1. Trying to enforce UTF8 encoding as default. This is what I am doing. service postgresql initdb -E 'UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype=locale='en_US.UTF-8'; Although the initilization process goes on without any…
ThinkingMonkey
  • 12,539
  • 13
  • 57
  • 81