PostgreSQL is an open-source, object-relational database management system (ORDBMS) available for many platforms including Linux, UNIX, MS Windows and Mac OS X. Please mention your PostgreSQL version when asking questions. Greenplum Database, Amazon Redshift, ParAccel, Postgres-XC, ...

learn more… | top users | synonyms (3)

0
votes
0answers
3 views

Spring security adding a user, and checking it in database later

I am using spring security framework with a spring-mvc application, and its been not such a good experience for me. So basically I would like to initially register a user with role 'ROLE_USER' in the ...
0
votes
0answers
3 views

Plpgsql 'Parameter was used more than once' detect all incidences

I'm moving my database from a 8.4 server to a new 9.1 one. Restoring a 8.4 copy in the 9.1 server throws no errors, but once I start using my plpgsql funcs I've been hit with the 'Parameter was used ...
0
votes
0answers
4 views

Modelling API: each row represents a table. Suggestions?

I have an app that stores user uploaded spreadsheets as tables in PostgreSQL. Everytime an user uploads a spreadsheet I create a record in a Dataset table containing the physical table name, its alias ...
0
votes
0answers
10 views

Convert user access query from postgreSQL to SQL Server

I am working on converting a PostgreSQL query to SQL server and trying to understand what exactly the query below is doing . I understand the joins but the rest is not clear at all . Could anyone ...
0
votes
0answers
5 views

PostgreSQL Row-wise comparision

Assume I've got two pairs from which I'd like to compare a field. ROW(date,bigint) Eg: ROW('2014-02-07'::DATE, 14::BIGINT) <= ROW('2013-05-05'::DATE, 11::BIGINT) Returns TRUE because of the ...
0
votes
0answers
5 views

Npgsql tries to connect to database “postgres”

I have simple ASP.NET MVC 4 application (just created it), that connects to remote PostgreSQL server via NpSQL + EF client. But it tries to connect to database "postgres" which is not allowed: ...
0
votes
0answers
9 views

Jboss 4.0.5 multible jdbc drivers

can i load multiple Jdbc drivers e.g mysql postgres etc to the application server and use the appropriate for each database ? i have jboss 4.0.5GA and i placed the postgress jdbc driver in /server/lib ...
0
votes
1answer
9 views

how to execute pgsql script in pgAdmin?

I want to execute some pgScript directly from the pgAdmin editor UI. FOR i IN 1..10 LOOP PRINT i; -- i will take on the values 1,2,3,4,5,6,7,8,9,10 within the loop END LOOP; But I always got ...
0
votes
1answer
13 views

Database table row prevention for multiple users access

I am using PostgreSQL with java spring application and requirement is , if any row in table access by any user then if same time another user will try to access the same row then this user will get a ...
0
votes
1answer
20 views

PostgreSQL for update statement

PostgreSQL has read committed isolation level. Now I have a transaction which consists of a single DELETE statement and this delete statement has a subquery consisting of a SELECT statement for ...
0
votes
1answer
19 views

Django create record in other table

I have a model as below: class Investee(models.Model): user = models.OneToOneField(User) There is of course the User model that comes with django outta the box. What I'm trying to do is once a ...
0
votes
1answer
15 views

grails domain constraints mapping to postgresql Gist constraint

I have a PostgreSQL table CREATE TABLE reservation_table ( idreservation SERIAL NOT NULL, entry_datetime TIMESTAMPTZ NOT NULL DEFAULT 'NOW', start_end_dates DATERANGE NOT ...
0
votes
1answer
20 views

DBI connect, failed: FATAL: sorry, too many clients already

I am running a crontab as described below : * 1 * * * /var/fdp/reportingscript/an_outgoing_tps_report.pl * 1 * * * /var/fdp/reportingscript/an_processed_rule_report.pl * 1 * * * ...
0
votes
0answers
13 views

Memory leak when deploying the web application

org.apache.catalina.startup.HostConfigdeployWAR INFO:Deployingwebapplicationarchive.war org.apache.catalina.loader.WebappClassLoadervalidateJarFile ...
-1
votes
0answers
23 views

is Dart team going to migrate or implement JDBC API? [on hold]

I know that there are some projects out there for connecting to databases: sqljocky postgresql Although both are great libraries it should be better if both implements the same interface so that ...
-1
votes
1answer
13 views

Psycopg2 Error: clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

Been trying to install psycopg2 in a multitude of ways, but I keep getting an error similiar to this one: $ pip install psycopg2 Downloading/unpacking psycopg2 Downloading ...
0
votes
2answers
20 views

Import PostgreSQL dump on OSX

I've only used MySQL before. Postgres is a little different for me. I'm trying to use the Postgres.app for OSX. I have a database dump from our development server, and I want to create the correct ...
-1
votes
0answers
16 views

Verify if point is inside a box in POSTGIS

I have a table in POSTGRES called "fields", this table contains a field called "the_geom" of type "box" that stores data, example: (-60.642314,-32.008922),(-60.664716,-33.003146) where (longitude1, ...
0
votes
2answers
25 views

How to call PostgreSQL stored procedures with JDBC

I'm using postgresql and I have created some stored procedures. Now I want to access the stored procedures via jdbc and process the results. The results of the stored procedures are either integer or ...
0
votes
0answers
5 views

Connecting Postgres Heroku with Knex not working

We're having difficulty setting up a Heroku/Postgres database with Knex running our queries. We've set up our heroku/postgres db and created our tables, but we're having difficulty connecting to it ...
0
votes
1answer
23 views

Creating a table with an age constraint based on a date_of_birth attribute with PostgreSQL

CREATE TABLE customer ( date_of_birth date NOT NULL ); Trying to make it so that someone cannot enter an age less than 18 when inserting values into the table. How would ...
0
votes
1answer
18 views

Calling a set-returning function with an array argument multiple times in PLPGSQL

This is a variation on plpgsql function that returns multiple columns gets called multiple times. However I was hoping to find a solution to my particular set of circumstances. I have a function that ...
0
votes
1answer
13 views

Exporting CSV from Rails postgres database - Adding Associations

I am trying to export information about users of my Rails app (that's hosted by Heroku). I followed this tutorial to export a CSV file: https://coderwall.com/p/jwtxjg This involved the following: ...
0
votes
0answers
18 views

With Recursive query join on postgresql

id parentid lon lat --- -------- ----- ------ 1 0 80.60 90.78 2 1 90.98 20.58 3 1 85.22 20.23 4 2 86.41 30.78 5 2 ...
2
votes
2answers
32 views

3 tables SQL query

I have three tables: niveis(id, descricao) formacoes(id, id_nivel, nome) formacoes_professores(id, id_professor, id_formacao) I'd like to run a query that returns the education levels(niveis) with ...
0
votes
2answers
30 views

Ruby on rails unique records

What is the best way to return the unique records from the database, please consider the following : @users = User.joins('LEFT JOIN subscriptions s ON users.id = ...
0
votes
1answer
15 views

PostgreSQL: Modifying column data type from Character Varying to Double Precision

I am encountering some problems regarding the alteration of column data types -- specifically from character varying to double precision. The goal of this modification is so I can perform SUM and ...
1
vote
0answers
19 views

How to get PostgreSQL restore to accept “;” and “\N” in data as part of strings?

Did a pg_dump on PG 8.4 and trying to restore on PG 9.1. Some of my data contains semi-colons, as in: 351717»·0»2014-04-28 13:26:23.119418»·2014-04-28 13:26:23.119418»·94642.000»1»0.000»LEASE» ...
0
votes
0answers
12 views

Why can't I give a PostgreSQL DSN the name I want?

System: Windows 7 64 bit PostgreSQL version: 9.3.4-4 (64 bit) pgsqlODBC version: 09.03.0210-3 Issue: I am able to successfully use the Windows Data Sources wizard to define a DSN for an ODBC ...
0
votes
2answers
39 views

How to convert oracle timestamp to postgres?

How to convert the oracle timestamp to postgres timestamp,we have a values in oracle data base as below, 15-JUN-2014 01.00.00.0000 PM I have stored as varchar in postgres/Greenplum. How can I cast ...
0
votes
1answer
17 views

How to make update query using data from two another tables (postgresql)

I have 3 tables: manager with columns: id serial PK money int facilities_work_data with columns: id serial PK income integer manager_facilities with colunns: id serial PK manager_id ...
0
votes
1answer
26 views

Connecting to a PostgreSQL database through pq (Go) returns a “bad connection” error

I am making a web app in Go and PostgreSQL using two different computers. The setup is the same on both computers (Ubuntu with last versions of Go and PostgreSQL). The problem is that I cannot get my ...
0
votes
1answer
16 views

Calculating distance between point and circle in PostgreSQL, what units are used for circle radius and distance?

I'm using geometric functions and operators: http://www.postgresql.org/docs/9.3/static/functions-geometry.html Table 'bank' Containing a geofence the type of which is circle with a 0.5 Radius. id ...
-1
votes
0answers
13 views

openshift -> unable to forward port for database

I'm new to openshift, I want to get the port for my postgresql database, but I'm unable to forward the port. I have the newest rhc client, and if i type "rhc port forward -a myapp", it type, error ...
0
votes
1answer
22 views

Pivoting equivalent in postgresql

I have the following statement in SQL Server where I am using pivot: Select YR, [1] As Beginning, [2] As Inter, [3] As Advanced, [4] As AdvHigh,Campus From (Select YR, Rating, StudentId, ...
0
votes
1answer
30 views

Rails, formtastic and postgres: NotNullViolation

this one isnt googling at all, so i have no choice but to bother you with such braincracker. I have 2 models, linked through HMT. I also have ActiveAdmin. When I try to create object from 1st model, ...
-3
votes
0answers
20 views

When is a DataSource connection actually necessary? [on hold]

In order to create a C# program that allows a user to fill a table with data, adding columns and rows and editing, do I really need to connect with a DataSource?
0
votes
0answers
10 views

Migration Issue after upgraded postgres to 9.3

bundle exec rake db:create --trace rake aborted! ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter ...
0
votes
1answer
22 views

use column of “super” table in postgres

SELECT value,(SELECT value2 FROM test AS x WHERE x.id = SUPER.id) FROM test I want to get the column of the table of the main query. Is this possible without giving it a name? Is there a replacement ...
0
votes
0answers
19 views

How can I import nested json data into multiple connected redshift subtables?

I have server log data that looks something like this: 2014-04-16 00:01:31-0400,583 {"Items": [ {"UsageInfo"=>"P-1008366", "Role"=>"Abstract", "RetailPrice"=>2, "EffectivePrice"=>0}, ...
-1
votes
0answers
24 views

group results by month beetwen 2 dates posgresql [duplicate]

have a table, example: start_date end_date euros 1/1/2014---31/1/2014-------100 1/1/2014---31/3/2014-------600 1/4/2014---30/6/2014-------300 I want to take the value for the date range and ...
0
votes
0answers
19 views

Performance issue - Process postgres database

Good morning!  I have a web application connected to a postgres database in Ubuntu.  I have the problem that there is a process within my database which consumes 100% of the CPU time.  How can I ...
1
vote
0answers
32 views

Why do I get a postgresql deadlock?

So I have spotted a deadlock in some update statements, though I can't see why they are blocking each other. Here is the error from the postgresql log file: 2014-09-29 13:49:34 CEST DETAIL: Process ...
1
vote
2answers
44 views

Improving postgres sub query using coalesce

Picture this: Two tables, cases and case_messages. A case can have any number of messages or none. One of these messages can be the final answer in a case. I now want to return a list of cases with a ...
-2
votes
1answer
15 views

Postgres backup from on premise to the cloud

I will like to deploy an application (powered by Postgres) offline, but i want it to synchronize with a backup online where the data can be safe and revert to any time. I will like pro's here to give ...
-1
votes
0answers
15 views

Postgress query analyzer/stats/metrics - tool needed

Are there any tools available to collect QUERY specific metrics for some period of time (to be analyzed afterwards)? Requirements: Should be simple to install and simple to use Should look at the ...
0
votes
1answer
40 views

POSTGRESQL: 1 query from 6 tables

I am trying to produce 1 query from 6 tables which is suppose to display the title, the production year and the total number of oscars it has won across all categories. I was trying to join them all ...
2
votes
0answers
30 views

How to delete HSTORE keys?

I have the following migration: class CreateFoos < ActiveRecord::Migration def change create_table :foos do |t| t.hstore :foos_properties end end end In the hstore column, I ...
2
votes
1answer
29 views

(Postgre)SQL Update query does not return

I've a simple update query (on two large tables) which does never finish. UPDATE transit_edge te1 SET dates_to_add = ( SELECT ARRAY_AGG(date) FROM transit_edge te2 LEFT OUTER JOIN ...
0
votes
0answers
33 views

Time intervals in Postgres (SQL design)

I need to represent the following resource in SQL (PostgreSQL): accounts and clients. A client is an account that is purchasing product, for a given year. I need to know which years accounts are ...