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
0
votes
1 answer

Postgresql inheritance and foreign key referencing parent table

I already documented about this and read other users post about this on so, but in my case the referencing should be working fine: I have several tables extending one "entity" table and an "association" table referencing just "entity" table. So I'm…
Damiano Barbati
  • 3,356
  • 8
  • 39
  • 51
0
votes
2 answers

Hibernate annotations for Serial id in Postgres 9.1

I have an error when I compile my Java code with this annotation: @Id @Column(name="\"idClass\"", unique=true, nullable=false, columnDefinition = "serial") @GeneratedValue(strategy=GenerationType.AUTO) private Integer idClass; with
django
  • 153
  • 1
  • 5
  • 19
0
votes
1 answer

Postgres date-numeric not working in function

Can anyone help me to resolve the issue ?? CREATE OR REPLACE FUNCTION func_maj_get_new_user(in_date numeric) RETURNS integer AS $BODY$ declare count_newusr integer; begin SELECT count(a.app_uid) INTO…
William R
  • 739
  • 2
  • 13
  • 34
0
votes
1 answer

Postgresql query with left join and having

Postgresql 9.1: I have a query that must return the values of a second table only if the aggregate function SUM of two columns is greater than zero. This is the data: Table a id --- 1 2 3 Table b id fk(table a) --------------- 1 1 2 null 3 …
OJVM
  • 1,403
  • 1
  • 25
  • 37
0
votes
1 answer

is it possible to insert rows from a local table into a remote table in postgresql?

I have two postgresql databases, one on my local machine and one on a remote machine. If I'm connected to the local database (with psql), how do I execute a statement that inserts rows into a table on the remote database by selecting rows from a…
Mike W.
  • 131
  • 2
  • 9
0
votes
2 answers

SQL subquery with average of 3 top values in Postgresql

I need a little help to solve a query to count patients (ID) who have the average of the 3 last diastolic tension (TAD) < 90. I've tried several type of nested subqueries with different errors. This is my last version I've done: SELECT CENTRO, COUNT…
Antonio
  • 3
  • 1
0
votes
2 answers

Permission Denied exception in PostgreSQL

While running my application, some times I'm getting the following errors. The application will halt the execution with this exception. org.postgresql.util.PSQLException: ERROR: could not open file "base/1459687/1472150": Permission denied;…
Sajeev
  • 783
  • 3
  • 14
  • 46
0
votes
1 answer

Need cleaner update method in PostgreSQL 9.1.3

Using PostgreSQL 9.1.3 I have a points table like so (What's the right way to show tables here??) | Column | Type | Table Modifiers |…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
0
votes
1 answer

Dynamic FROM clause in Postgres

Using PostgreSQL 9.1.13 I've written the followed query to calculate some data: WITH windowed AS ( SELECT a.person_id, a.category_id, CAST(dense_rank() OVER w AS float) / COUNT(*) OVER (ORDER BY category_id) * 100.0 AS percentile …
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
0
votes
3 answers

Rails query: Compare calculation of two attribute values

I have a model, Product, which has both a :created_at timestamp and an :expiration_in_days attribute. Products are considered expired a certain number of days after their creation. How do I write a query that only returns products that have not…
steel
  • 11,883
  • 7
  • 72
  • 109
0
votes
2 answers

JBOSS and JPA query- Adding a new customer

I have been battling with this for the last few days and am at the end of my tether. Please can someone help me figure out where/why I am going wrong. Thank you very much indeed. Here is my story: I am building a web EE application using JBOSS…
0
votes
1 answer

Django QuerySet changing IN to ANY(array[...])

We've got some slow running queries in our DB and I think some of them can be solved by changing the underlying SQL. Given the following: Model.objects.filter(rel_id__in=[1,2,3]) Outputs (abridged): SELECT all, the, fields FROM "model" WHERE…
justcompile
  • 3,362
  • 1
  • 29
  • 37
0
votes
0 answers

Converting two column of data to proper tabular format

I'm having the data in format given below. Col1 | Col2 _______________ item1 | orange item2 | apple item1 | guava item2 | noodles ... I want data to be in below format. item1 | item2 _______________ orange | apple guava | noodles ... I'm…
Krishna
  • 1,865
  • 4
  • 18
  • 26
0
votes
1 answer

undefined symbol: GEOSRelatePatternMatch

Trying to add the postgis extension to postgresql but getting the error; ERROR: could not load library "/usr/lib/postgresql/9.1/lib/postgis-2.1.so": /usr/lib/postgresql/9.1/lib/postgis-2.1.so: undefined symbol: GEOSRelatePatternMatch Any…
Mark Corrigan
  • 544
  • 2
  • 11
  • 29
0
votes
1 answer

Merging same structure databases but keeping their existing data.

Currently I have 3 (same code base apps) with it's own databases and own unique data. Were moving towards doing multi tenancy in rails, after a couple of prototype testing we've decided to go for a shared tenancy. My only biggest problem is that,…
Berimbolo
  • 293
  • 2
  • 12