PostgreSQL is an open-source, object-relational database management system (ORDBMS) available for all major platforms including Linux, UNIX, Windows and OS X. Please mention your exact PostgreSQL version when asking questions. Questions concerning administration or advanced features are best ...

learn more… | top users | synonyms (3)

0
votes
2answers
10 views

How To Find Related Record ID Based Reference Document No on SQL Statement

Hello I am not sure how to describe regarding my problem. It's make me headache this week. I need to show related record id based document no as reference in same table. I try many time and direction ...
0
votes
0answers
14 views

Data migration from MS SQL to PostgreSQL using SQLAlchemy

I am using SQLAlchemy 1.0.11 to migrate an existing database from MS SQL 2012 to PostgreSQL 9.2 (upgrade to 9.5 planned). I've been reading about this and found a couple of different sources (Tyler ...
1
vote
0answers
7 views

Spring Boot application with Postgres: indexes not being used during first use

I have a Spring Boot application that is using a Postgres database. When the application is deployed I need to run a transactional operation that uploads a zip file that is used to populate the ...
1
vote
2answers
46 views

Using Koa with bluebird and pg

I have a question about the best way to use Koa with Postgres. I also (really) like using Bluebird, so I've gone with this approach. 'use strict'; var db = require('./modules/db.js'); var koa = ...
0
votes
0answers
2 views

Teradata studio express - width_bucket error

Using postgre sql in Teradata studio express, I am trying to run the following script but getting an error. select customer, total_spend, width_bucket(total_spend, -100, 200, 10) from data.spend; ...
0
votes
3answers
24 views

Changing a Select Query to a Count Distinct Query

I am using a Select query to select Members, a variable that serves as a unique identifier, and transaction date, a Date format (MM/DD/YYYY). Select Members , transaction_date, FROM table WHERE ...
0
votes
0answers
6 views

Converting postgres box to .Net NpgsqlBox

I am trying to connect to a postgres database and pull out a box data type and parse it into a NpgsqlBox. I was hoping there would be a constructor such as: new NpgsqlBox(reader.GetString(0)); ...
0
votes
0answers
4 views

ODB With PostgresSQL bad_alloc Exception

I tried to to use ODB within my project. Therefore I used VS2015 to compile the windows sources for their odb and odb-pgsql library choosing the Release and x64 configuration. I linked the libraries ...
1
vote
1answer
9 views

postgresql statement prob

I have two table A and B as following. A: key type 0 t 1 f 2 t 3 f 4 t 5 t ....... B: key name 0 Mary 0 Tony 0 Krolik 1 Tom 2 Tony 3 Tony 3 Mary 3 ...
0
votes
1answer
19 views

How Are Connections Grouped when Pooling?

I am using Npgsql to connect to a Postgres database on Windows using C#. In the connection string I have: ...
1
vote
1answer
5 views

Postgres 9.4 how can i do a max constraint on an int field

I am new to postgres and have been trying to find a way to put a max limit on a Field. I have a field in the database named friends and it is of type INT I want to put a constraint on that field of 30 ...
0
votes
1answer
13 views

Sequelize grouping by date, disregarding hours/minutes/seconds

Hey so im trying to query from a database, using Sequelize (Node.js ORM for postgreSQL), im trying to group by date range, and keep a count of how many items where in that table. Right now the code i ...
4
votes
5answers
178 views

Way to try multiple SELECTs till a result is available?

What if I want to search for a single row in a table with a decrementing precision, e.g. like this: SELECT * FROM image WHERE name LIKE 'text' AND group_id = 10 LIMIT 1 When this gives me no ...
0
votes
2answers
31 views

Ember.js + Ember Data + PostgreSQL

I'm having trouble understanding how to connect Ember.js with PostgreSQL using Ember Data adapter. My main problem is finding a complete example where I can study how I would do this. I know I have ...
0
votes
0answers
5 views

h2 equivalent for postgres function string_to_array

I am trying to find an equivalent function in h2 for postgres function "string_to_array". I ran through the h2 documentation i couldn't find one.
4
votes
2answers
138 views

Trouble connecting to Heroku DB with pgAdmin III client

I'm running into trouble connecting to a heroku database with pgAdmin3. I've filled out the Add Server options in pgAdmin3 as described in this question / answer. The error I receive is FATAL: ...
0
votes
0answers
6 views

Identity Column not respected on Insert into() (Amazon Redshift)

I initially ran into this when I was selecting from one table with an identity, primary key and sort key into another table with its own set of identity, primary, sort. Instead of respecting the (1,1) ...
0
votes
1answer
20 views

Hibernate xml configration

I 'm using xml to configure hibernate and using PostreSQL DBMS, but i get an error. This working when using hibernate.properties file and using configuration progrmatically, but with xml is seems ...
0
votes
1answer
10 views

SQL Insert Into ColX Table 1 Select ColY from table 2 where Table1.colA=Table2.ColB

I'm much more a java than a sql developer. I have looked on SO for this, but for some reason cannot find a question with similar WHERE criteria In PostgreSQL, the following syntax is incorrect ...
0
votes
1answer
9 views

Using ILIKE on an ENUM in SQL

On a web frontend search, I would like users to be able to type 'wed', 'wednesday', 'Wed', etc. to select the day of the week. Given the enum set for days of the week, ('Monday', 'Tuesday', ...
1
vote
1answer
21 views

Inserting data into postgresql json columns using clojure.java.jdbc

I'm trying to do an insert into a json column in a postgresql database using clojure.java.jdbc/insert!. I'm not sure which data format should be used when inserting json. Table definition: CREATE ...
28
votes
4answers
13k views

Any reason not use PostgreSQL's built-in full text search on Heroku?

I'm preparing to deploy a Rails app on Heroku that requires full text search. Up to now I've been running it on a VPS using MySQL with Sphinx. However, if I want to use Sphinx or Solr on Heroku, I'd ...
0
votes
1answer
33 views

SQL query to make one column for every date in range

Give a simple table like this: ClientCode | Date | Amount -------------------------------- 1 | 2014-01-01 | 10 1 | 2014-01-01 | 20 2 | 2014-01-01 | 30 1 | ...
0
votes
1answer
13 views

Automating data dump and restore between Postgres and MySQL

I've just set up a delta-loading data flow between multiple Mysql DBs and a Porgres DB. It's only copying tens of Mbs every 15mins. Yet, I'd like to set a process to fully load the data between them ...
2
votes
0answers
28 views

Apparently matching strings not matching in Postgres

I have 2 database servers. One of them is running Postgres from a point in time base backup. Both report the client_encoding as UTF8. I can query the primary database fine but when I query for a ...
1
vote
1answer
11 views

Postgres UPSERT UPdate using rows values

If my table looks like this CREATE TABLE public.temperatures ( temperature_io_id integer NOT NULL, temperature_station_id integer NOT NULL, temperature_value double precision ...
0
votes
0answers
9 views

Using 'inspectdb' got error 'IndexError: list index out of range' (probably because there is no some FKs). Pls advice workaround

PostgreSQL v9.4.5 Django v1.9 I want to generate models from my 'legacy' DB. When I use inspectdb I receive: File ...
1
vote
2answers
20 views

How to pass record value into a subquery (PostgreSQL)?

I have two files: apt, and appointment_history. The second file has multiple records referencing single records in apt. How to I get only the last record in appointment history that is referencing ...
0
votes
2answers
38 views

Connecting to a postgresql db using JDBC from the Bluemix Apache Spark service

I have a problem connecting to my postgresql 8.4 db using Apache Spark service on Bluemix. My code is: %AddJar https://jdbc.postgresql.org/download/postgresql-8.4-703.jdbc4.jar -f val sqlContext = ...
0
votes
0answers
8 views

postgresql json date format issue

I am having issues with my postgresql dates. I a column with type date. An example value in the column is 2016-01-28. However, when I make an AJAX request to retrieve data from the server, the date is ...
0
votes
0answers
7 views

How to decide which Postgres server stack a Rails app points to

I'm new to Ruby on Rails on Windows and I'm trying to setup my first app. I've installed two versions of PostgreSQL, both 32-bit and 64-bit versions. I've generated a new rails model and I've written ...
0
votes
1answer
12 views

Building a C Program using PostgreSQL on Windows with Visual Studio Community 2015

I'm trying to go through an example using C and PostgreSQL, but I'm unable to find the libpq-fe.h when I try to compile through Visual Studio Community 2015 on Windows. I've looked at this answer ...
0
votes
1answer
22 views

Optimize read-only Mysql slave

I'm having trouble for a delta loading project of mine :) Context: my Postgres-based data warehouse is pulling data from my Mysql-based webshop everyday. We set up a read-only slave for this, and i ...
-4
votes
2answers
25 views

Calculate Date on Query [on hold]

in a query that returns me three results, I wonder how many days PERSON "A" remained in every SITUATION. PERSON      SITUATION          DATE "A"   ...
12
votes
3answers
4k views

django.db.utils.ProgrammingError: relation already exists

I'm trying to set up the tables for a new django project (that is, the tables do NOT already exist in the database); the django version is 1.7 and the db back end is PostgreSQL. The name of the ...
3
votes
1answer
39 views

Replication between Mysql and Postgres for data warehousing

Context: my DBA has written scripts to delta load data from a Mysql slave we have of our main OLTP to our Postgres DWH staging DB. He's leaving and I want to find a more sustainable way to handle ...
0
votes
0answers
14 views

JBoss WildFly can't find database table in form-based authentication

I've just started programming with Java EE and I'm trying to implement a simple web app that uses form-based user authentication with the JBoss database login module. When I run my web app and go to ...
2
votes
1answer
26 views

PostgreSQL Select highest value within time period

Using Rails, I'm trying to perform a SQL command to return an array of rows that contain the highest value for a certain user per day. For example: user_id(integer) | created_at(datetime) ...
0
votes
0answers
6 views

SQLAlchemy Updates/Inserts after Multi-DB JOIN

I have a table that needs to be updated with values that are maintained in a different database, and would like to do this in batches with sqlalchemy. MySQL - table1 PostgreSQL ...
-1
votes
1answer
23 views

PostgreSQL not closing transactions using JPA, JEE6

I have a method that I use to gather data for a report, while running I monitor the PostgreSQL server and I see that the system does not close the transacition after they end. The problem is that in ...
1
vote
0answers
8 views

How to create/connect a postgres database in Pony ORM?

I'm trying to create/connect a postgres database to a Pony ORM web application that I'm doing. At first I used a sqlite database with Pony ORM and everything worked fine but I need to switch to ...
0
votes
1answer
14 views

AWS Unload Error: 'The bucket you are attempting to access must be addressed using the specified endpoint.'

I am running the following query in SQL. I am trying to unload data from Redshift to a bucket in my personal S3 account: UNLOAD ('SELECT * FROM table WHERE UPPER(description) LIKE \'%something%\') ...
0
votes
0answers
8 views

Docker wait for postgresql to be running

I am using postgresql with django in my project. i've got them in different containers and the problem is that i need to wait for postgres before running django. At this time i am doing it with sleep ...
0
votes
0answers
8 views

Postgres installation no longer working

I'm on OSX (el capitan) and running brew installed postgres 9.5.0 Although it worked previously I'm getting the below error: psql: could not connect to server: No such file or directory Is the ...
0
votes
2answers
24 views

How to create a huge string in Postgresql

For testing / debugging purposes, I need to get an enormous string into a field for one of my records. Doesn't matter what the string is. Could be a million "*"s or the contents of Moby Dick.... ...
1
vote
0answers
12 views

how to get the affected base table row count in a statement level trigger

I have these tables: CREATE EXTENSION citext; CREATE EXTENSION "uuid-ossp"; CREATE TABLE cities ( city_id serial PRIMARY KEY, city_name citext NOT NULL UNIQUE ); INSERT INTO ...
0
votes
2answers
24 views

Flask : sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation “users” does not exist

I am working on a flask app based on http://code.tutsplus.com/tutorials/intro-to-flask-signing-in-and-out--net-29982. As part of the tut I'm trying to connect to a postgres server, with a ...
0
votes
1answer
12 views

Cocoon and PostgreSQL updating all fields but boolean check box

I am using the Cocoon Gem with Bootstrap_Form_for in my rails 4 application. Everything is working and I have no problem creating and updating all of my fields except when I try to change an already ...
1
vote
0answers
21 views

Postgresql query did not terminate, after restart the service postgresql doesn't start

At my work I was running a complex query. I cancelled it and went home yesterday. This morning in the back the query was impossible to be terminated, also with the 'terminate backend' functionality. A ...
0
votes
2answers
222 views

JAVA + Postgres Limit connections , how to close it ! FATAL: sorry, too many clients already

I need to release connection to postgres My java application interact with postgres and my problem is when i need to call this function more than 200 time postgres crashes , normal thing ... because ...