PostgreSQL is a powerful, enterprise class, open source RDBMS. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability and data integrity. It runs on all major operating systems, including Linux, UNIX and Windows. It prides ...

learn more… | top users | synonyms (1)

1
vote
1answer
42 views

What indexes would I create for a query like this?

Here's a query I've got: SELECT "balance_transactions"."fee" FROM "balance_transactions" JOIN charges ON balance_transactions.source = charges.balance_id WHERE "balance_transactions"."account_id" = ...
0
votes
2answers
90 views

Schema for lists of relationship differences

Say there is a data model that allows for relationships to be defined either explicitly or as a list of records added or removed relative to some existing item: Item <–> *Properties and Item ...
1
vote
2answers
104 views

Postgres slave max_connections = master's max_connections?

I am using binary replication for Postgres. Is it true that the max_connections has to be the SAME for both the master and slave in postgresql.conf? Can they be different?
4
votes
0answers
116 views

PostgreSQL Transaction Committing for hours

I'm running into an issue whereby I have two connections from a user to my PostgreSQL server which have been running for about 4 hours and have been in a commit state for quite some time (at least 1 ...
2
votes
3answers
951 views

Counting postgres open connections without SQL query or connecting to postgres itself

For a monitoring script I need to count the number of open connections to a postgres database. This is done easily enough by opening up a client connection and running a count on the pg_stat_activity ...
0
votes
2answers
72 views

How to change table/indexes structure for a query with two aggregated colums

Do you have any suggestion on how to improve a table structure or its indexes in order to have a single query run faster? The table has this structure: docid | character varying(17) | ...
1
vote
2answers
665 views

Migration from SQL Server 2008 to Postgres 9.2 [closed]

I have a rather large database (2 GB of data, 25 million rows in the largest table) on a shared web hosting. The database engine is Microsoft SQL Server 2008. Due to high fees for the SQL Server web ...
0
votes
1answer
48 views

How to alter column from float(8) to numeric(64,8)

I am working on a website that store lots of numbers in a very specific precisions (8 digits). Most of the columns are using numeric(64,8), but I discovered that a handful are using float(8) instead, ...
0
votes
2answers
184 views

how Postgres works internally [closed]

I would like to learn how postgres works i.e how queries are handled internally,the read and write performance ? I don know where to start,help me with refrences
0
votes
0answers
101 views

Is there failover server parameter in PostgreSQL connection string?

Is there failover server parameter in PostgreSQL connection string that can be used to automatically switch from primary server to secondary sever ? We have been using similar functionality on MS SQL ...
1
vote
0answers
565 views

High availability PostgreSQL 9.3 server on Windows

I'm trying to set up PostgreSQL 9.3 server in HA mode on 2 Windows servers. Final solution should be deployed to Microsoft azure network, so there are few limitations. Since Microsoft is doing ...
0
votes
0answers
478 views

Stress-test PostgreSQL 9.2 and pgpool

i am experiencing some trouble testing Postgres cluster and load balancer on pgpool. I i wrote script script.sh on bash which asynchronously uses Postgres testing tool pgbench causing number of ...
2
votes
1answer
470 views

PostgreSQL JSON field performance with large documents

How well is the Postgre JSON type optimized for large JSON documents? I am especially concerned about partial retrieval (e.g. the cost of getting the last N items of a JSON array or looking up one ...
0
votes
0answers
90 views

Can’t connect to local PostgresSQL server

I have the Postres app installed an running on my Mac. And it has worked beautifully. I don’t know what changed, but now I cannot connect to it from Rails, PG Commander, PG Admin or the command psql ...
0
votes
2answers
53 views

Help with query statement

EDIT This query seems to work best so far. select host,plugin_id,month,year, row_number() over (partition by plugin_id order by plugin_id) as plugin_split from table where risk in ('High') group ...
2
votes
1answer
2k views

Superuser is not permitted to login

I created a superuser portal with the following command create role portal with superuser password 'portal' When I tried to login into postgres with portal user I am getting the following error in ...
0
votes
1answer
43 views

pg_dump inserting C source code in dump file

Am backing up daily my DB with pg_dump. The strange issue is that when I try to restore it with psql, errors are thrown. After opening the dump file with vim and analyzing the line that is causing the ...
4
votes
1answer
1k views

How to configure replication from PostgreSQL (RDS) to vanilla PostgreSQL?

I have an Amazon RDS Postgres DB and I created a "replicator" user and granted it the "replication" privilege. db=> create role replicator login password 'something'; CREATE ROLE db=> alter ...
0
votes
0answers
53 views

pgpool not selecting new master

I have a master-slave Postgres setup in basic streaming replication I'm trying to get behind pgpool-II. I have servers replicating find and connections to pgpool look to be getting load balanced ...
0
votes
1answer
340 views

Postgres 8.3 faster than 9.3?

Our software product currently ships on Windows 7 with Postgres 8.3 as its database. On a busy site, there may be 24 automated systems generating 100 rows (x100 columns) per minute, with 3-10 human ...
1
vote
2answers
88 views

Wrong index used in Postrgres

I have Postrgres 9.3 running on a Linux machine with 32GB RAM. I have a fairly large database (some tables with approx. 1 mil. records) and I have the following query: SELECT * FROM ( SELECT DISTINCT ...
3
votes
1answer
324 views

How to correctly return a query result only if it isn't NULL?

I'm writing a PL/pgSQL function that creates a cursor for a query that I need to check whether it returns something. What I'm doing is this: Run the query Check whether it returns something. If it ...
1
vote
1answer
51 views

restoring Postgres dump with tablespaces

I'm trying to restore a dump done with pg_dumpall > mybak.sql from a server that has 1 table in a different tablespace that the default one. On the target machine I have recreated the directory ...
0
votes
1answer
164 views

PostgreSQL: Cannot Connect to Server via PgAdmin, Password Auth Failed [closed]

I've been attempting to connect to my server's PostgreSQL database. The error message I am getting is "Error connecting to the server: FATAL: password authentication failed for user "postgres" I've ...
5
votes
0answers
163 views

Storing and querying rolling data in PostgreSQL

I have a large quantity of weather model data being put into a PostgreSQL database. The machine has 8 cores and 16 GB of RAM. I'm running PostgreSQL 9.3 with PostGIS 2.1. Each table will have a ...
0
votes
1answer
63 views

Subtracting dates give me error in Postgresql

I use age to get the interval between to date fields. Their type is timestamp. My code is as below: select age(timestamp MySecondDateField, timestamp MyFirstDateField) The data in my field ...
1
vote
1answer
2k views

Installing and configuring postgresql 9.3 on ubuntu 13.10 using puppet

I'm having some trouble getting postgresql[1] to install with puppet[2] on a blank ubuntu box. I need to install postgresql 9.3 on Ubuntu 13.10. Since postgresql 9.3 is apparently not in the official ...
0
votes
1answer
263 views

pgpool-II configuring multiple master databases

I could not find a solution for this anywhere, not even in the pgpool manuals. How do I configure multiple - master postgresql databases with pgpool-II? Additional requirement is that each master ...
0
votes
1answer
55 views

Rotate Postgres log at 5GB

How to make postgres 9.1 log to have maximum size 5GB and to be circle when comes to 5GB ? At the moment my log file is over 500GB. /var/lib/postgres/
4
votes
1answer
154 views

PostgreSQL does not use all available IOPS on a single operation

Using PostgreSQL 9.3 on Windows 7x64, CoreI7, SSD. Assume a PostgreSQL table with 8 Int32 columns and following C# code to fill the table. using (var connection = new NpgsqlConnection("User ...
-1
votes
1answer
104 views

Group by for UNION not working Postgresql

I can't find a way to make Group by works in Postgresql, How can i make group by works so each name will be only one , not repeated many times like what i got in this picture? Here is a code for what ...
6
votes
1answer
4k views

MongoDB performance vs. PostgreSQL with 5.5 million rows / documents

Can someone help me compare these queries and explain why the PostgreSQL query executes in just under 2000ms and the MongoDB aggregate query takes almost 9000ms and sometimes as high as 130K ms? ...
2
votes
1answer
78 views

How to create Select query function in the Postgresql?

I want create select function in postgres and get all data from table. I many example see and try but not perfact execute function. What perfact syntax for select query function create in postgres? ...
1
vote
1answer
96 views

PostgreSQL's Query Hierarchical data poor performance

Badly need some technical assistance on this query performance issue I'm working on. Summary of the data structure is: 1 project has many homeprofiles, 1 homeprofile has many tasks, 1 task has many ...
1
vote
1answer
107 views

Postgres streaming replication to a different schema on another server?

We've got a system with about a dozen Postgres 9.3 databases representing a dozen different applications. In order to do reporting across systems, we have a script that dumps each database and loads ...
3
votes
1answer
95 views

postgres filtering select based on combination of joins

I am having trouble filtering a request that depends on a combination of child elements (one-to-many relationship) Please consider the following example. CREATE TABLE sample_container ( id serial ...
1
vote
1answer
426 views

Can't restore my distribution DB postgres 9.2 backup into my staging DB postgres 9.3

I keep getting this pg_restore: [archiver] did not find magic string in file header when i execute a pg_restore -Fc -U "username" -d "dbname" "filename".dmpon my staging DB. These DB are running on ...
0
votes
1answer
86 views

Issues with 'plus symbol' output in PSQL on update query

Simple but frustrating issue... I'm trying to do an update command to correct a misspelling with this field: grouper=> select * from master_list WHERE group ~ 'JustAdopted'; group | ...
0
votes
1answer
197 views

Postgres pgpool increase num_init_children

I am trying to tune postgre to allow many concurrent queries from clients as i am checking how many parallel connections with there queries it can handle. I read A good PgPool II configurataion , ...
0
votes
2answers
131 views

How to list all table columns in sorted order?

I know that \d table_name lists all columns for that table, but is there a way to list them sorted in alphabetical order?
0
votes
0answers
1k views

Postgres FATAL: could not open relation mapping file

I installed postgress.app on mac os when I try to connect to console : psql -h localhost I got this problem . psql -h localhost psql: FATAL: could not open relation mapping file ...
0
votes
0answers
138 views

Can't connect to local Postgres databases

After trying to install Postgres using Postgres.app and EnterpriseDB, I decided to re-install it using Homebrew (As I got some problems connecting to database). PYTHON=/usr/local/bin/python brew ...
0
votes
2answers
259 views

How do I use an Ispell dictionary with Postgres text search?

Postgres can use Ispell-compatible dictionaries in text search, but does not provide the required files.
0
votes
1answer
34 views

What configuration to use for PGbouncer over a WAN link

We have two datacenters, one in America and one in Europe. For various reasons, the Europe datacenter has the database server, while the workers and web apps are in America. PGbouncer is in the ...
0
votes
1answer
53 views

Postgresql Write Only Primary Server Bottleneck for Streaming Replication

I'm wondering about whether CPU/RAM plays an important role for the primary server for a Postgresql Streaming Replication setup where you have one primary server that receives all the write operations ...
0
votes
2answers
173 views

Can't run PostgreSQL locally

I am working to run PostgreSQL is running locally but I cannot connect. I installed postgress using brew, then I downloaded http://postgresapp.com When I try to create a database createdb: ...
2
votes
2answers
61 views

Postgres CREATE DATABASE already has data and tables

When I do a: DROP DATABASE mydb; and subsequently: CREATE DATABASE mydb WITH OWNER user; the new mydb database is created with all the tables and data that I had in the database I just dropped. What ...
0
votes
0answers
168 views

How to copy PostgresSQL database from remote server to LOCAL PC WITHOUT PG_DUMP(ALL)?

How to copy PostgresSQL database from remote server to local PC without pg_dump (or pg_dumpall ? Any format is good (plain text,sql,csv..) I have NO root access to remote PostgresSql database and I ...
1
vote
1answer
66 views

PostgreSQL - Create view with autoincremental column

I have a PostgreSQL table, and I need to create a view with a new column. This column needs to be an auto-incremental column starting at 1 and going to N. Is this possible to do without effecting the ...
0
votes
1answer
61 views

Postgresql Logging Questions

I'm seeking some help understanding my PostgreSQL 9.3 log file. (Note: maybe this should be multiple questions, they are all involve the same general topic - which is understanding my log file). In ...