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)

0
votes
1answer
75 views

Postgres: Estimate of server specs required for write-heavy load?

I'm looking for a rough estimate on what kind of server specs is required for a system that will have 1000 or so concurrent writes. There will be 100+ concurrent reads, but they won't require a ton of ...
2
votes
0answers
11 views

Postgresql JDBC Table Valued Parameters

MSSQL has a great feature called Table Valued Parameters. It allows you to pass a table of a custom data to stored procedures and functions. I was wondering what is the equivalent , if exists, in ...
1
vote
1answer
44 views

Trouble with installing additional modules on Postgresql 9.1 on ALT-Linux

I'm trying to create extension under postgresql 9.1 (Linux): CREATE EXTENSION pg_trgm; but got error: ERROR: could not open extension control file "/usr/share/pgsql/extension/pg_trgm.control": No ...
2
votes
1answer
19 views

How to create function(table_name) that returns a set of the table

I have a set of tables that share the same fields (some timestamps and users names used for version control). I need to create a function with dynamic sql that uses a table_name and a timestamp as ...
0
votes
2answers
23 views

Returning empty string when string_agg has no records

I am trying to return a text field in a PostgreSQL query that is of the form 'stringOne' || string_agg(field, ',') || 'stringTwo' where for certain elements in the group clause, field is always ...
0
votes
0answers
10 views

How to pass log file in pg_dump

I am using this command to export. export PGPASSWOD=${PASSWORD} pg_dump –i –b -o -host=${HOST} -port=5444 -username=${USERNAME} -format=c -schema=${SCHEMA} --file=${SCHEMA}_${DATE}.dmp ${HOST} ...
0
votes
1answer
16 views

Merge left outer join column

I have a query that use left outer join. something like that : select issues.id, journal.notes from issues left outer join on (issues.id = journal.issue_id and journal.notes != '') So far it ...
0
votes
0answers
17 views

Is there a psql equivalent of bash's reverse-search-history?

I am very fond of bash's reverse-search-history (C-r) (command-line feature): Search backward starting at the current line and moving ‘up’ through the history as necessary. This is an incremental ...
0
votes
1answer
114 views

PostgreSQL user permissions

I have a PostgreSQL 9.3 database with the PostGIS extension backing a web application and GeoServer. I have created three users. A read only user for accessing the data in the reference data schema. ...
1
vote
0answers
493 views

Can't set up witness in Repmgr 2.0

I am trying to setup repmgr using the autofailover quick setup tutorial provided on Github Link But I am kind of stuck on the witness section, when trying to create the witness with repmgr -d repmgr ...
0
votes
0answers
25 views

what values to set for the folowing PostgreSQL Variable [on hold]

I need to optimize my DB, in order to fine tune, what values to provide for the following variables, please advise, thanks. PgSQLIdleQuery PgSQLXclLock PgSQLConnections PgSQLMaxTTime PgSQLMaxQTime ...
0
votes
1answer
81 views

Sync offline PostgreSQL server

I am new to PostgreSQL. I am looking for a solution wherein 2 mirror images of a database sit on a local and remote server. All the work is done on the local server and at periodically synced with the ...
2
votes
1answer
59 views

Postgresql not using GIN trigram index when performing non-ASCII LIKE query?

Steps to reproduce Create database CREATE DATABASE citiesdb WITH OWNER = citiesowner ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'C' LC_CTYPE = 'C' ...
0
votes
1answer
81 views

Circular foreign key deferrable cascade behavior

I am trying to determine what happens for a particular circular foreign key that will cascade delete. Please feel free to address any other possibilities that my inexperience has not listed. On my ...
1
vote
1answer
91 views

How do I access a old saved tablespace after reinstalling postgres?

So a lot of things might have gone wrong here. I first installed postgres 9.3 on mac 9.1 via homebrew to manage some data. I am using postgres.app. Turns out my harddrive was too small so I decided to ...
0
votes
1answer
83 views

Taking hot backup of slave node in postgres (master-slave config with repmgr)

I have a postgresql setup with master-slave configuration using repmgr. I'm struggling with taking a consistent snapshot backup (pg_start_backup) of the slave node, this is due the fact that the slave ...
2
votes
2answers
51 views

Get count of processed queries

I have been searching a while to find a way to retrieve the amount of queries my postgres database is processing and responding to. I found various statistics about disk I/O, insert/update statistics ...
0
votes
0answers
37 views

PostgreSQL DB size increasing after restoring the same database backup [on hold]

I have already asked this in stackoverflow. This is my batch script to take backup: @ECHO OFF d: cd Apps\RemedyStar 9.0 KREMCOS\bin\Debug\PG pg_dump.exe -i -h localhost -p 5432 -U postgres -F c -b ...
0
votes
1answer
30 views

Postgresql condition on subquery results

This is a new question based on the solution to my previous question I have the following tables: users int (pk) user_id date last_visit int (fk) local_site sites int (pk) site_id site_stats ...
0
votes
1answer
18 views

postgresql being slow on count distinct for dates

I have a very simple, but very big, table. Its schema is like this (yadda int, yadda1 int, yaddate date, ... other stuff). Now, yaddate has an index by itself and it is also in other indexes ...
1
vote
1answer
41 views

Unnest multiple arrays into rows

I have been shown a great way to bulkinsert with this example: WITH p AS ( INSERT INTO parent_table (column_1) SELECT $1 RETURNING id) INSERT INTO child_table (parent_table_id, ...
0
votes
1answer
31 views

Unable to Start PostgreSQL. kernel's SHMMAX parameter exceeded you limit

When I am trying to start my PostgreSQL I get the following error in the Postgresql.log file: FATAL: could not create shared memory segment: Invalid argument DETAIL: Failed system call was ...
0
votes
1answer
18 views

Insert a file into PostgreSQL BYTEA field using PHP

The previous answers have been horribly complex for the scope of this project. I want to take the $_POST result as a variable and insert it into a BYTEA field of a table. $_SESSION['username'] = ...
0
votes
0answers
31 views

Update query taking 8x times in hot standby environment of Postgresql

I configured streaming replication (hot standby) and tested the update query on it. The update query is taking 8 times more when compared with stand-alone PostgreSQL (9.2 version) system. Some ...
2
votes
1answer
33 views

Recovering a partial PostgreSQL archive

I have $PGDATA/base but nothing else. It was taken from an installation after the postgreSQL service was shutdown, so is clean. Is there any way to recreate the other elements in $PGDATA that allow ...
0
votes
1answer
104 views

Best Approach to storing chat history?

I'm building a chat application (Yes, another one :P) and am really curious about the best way to store a chat's history(String username, String Message, Time, and possibly string channel depending on ...
2
votes
2answers
92 views

How slow is slow in postgres?

I'm working with postgres for the first time. I have a lot of experience with small / medium size data analysis (i.e. things that fit in ram and can be analyzed in R, Stata, Matlab, etc.), but am now ...
2
votes
1answer
36 views

Tuning Postgres for Single connection use? Or is postgres wrong tool?

Any rules of thumb for work_mem, maintenance_work_mem, shared_buffer, etc. for a database that DOESN'T anticipate concurrent connections and that is doing lots of aggregate functions? I'm a social ...
0
votes
1answer
17 views

PgPool fails to auth in master_slave mode

We have two PostgreSQL servers running in master-slave streaming replication mode, behind pgpool. When we activate master_slave mode in pgpool.conf, we get following error: do_md5 failed in slot 1 ...
0
votes
0answers
23 views

While impoting 150 GB file on Amazon RDS, why connection is failing?

I am having Postgres database dump file of 150 GB on Amazon EC2 instance. While dumping the data on RDS from EC2 server I am getting error. The output of the command is as given below. It's giving ...
2
votes
1answer
29 views

How do I sort the results of a recursive query in an expanded tree-like fashion?

Let's assume you have a nodes tables like this: CREATE TABLE nodes ( node serial PRIMARY KEY, parent integer NULL REFERENCES nodes(node), ts timestamp NOT NULL DEFAULT now() ); It ...
1
vote
1answer
37 views

Select query for returning different data based on creation time

I have a view, which will Select data from table reports the select will filter the data based on multiple dates. reports table: id, key_id, position, created_at My select: pr.key_id, ...
8
votes
1answer
4k views

PostgreSQL Database Data File Integrity Check

When running a PostgreSQL database system how do I know my database as a whole has 100% integrity? Basically how do I know if my data files and pages are all 100% good with no corruption? In the ...
1
vote
1answer
134 views

Postgres ODBC driver versions

On the Postgres ODBC driver page the name for each file is of the form: psqlodbc_09_01_0100-x64.zip psqlodbc_09_01_0100.zip psqlodbc_09_01_0100-1.zip psqlodbc_09_01_0200-x64.zip ...
0
votes
1answer
63 views

Adding unsigned 256 bit integers in PostgreSQL

I was wondering if there would be any way to do the following in PostgreSQL: UPDATE cryptotable SET work = work + 'some big hexadecimal number' where work is an unsigned 256 bit number. Right now ...
10
votes
7answers
3k views

Are there any good tools for monitoring postgresql databases

I am planing to have very soon few highly loaded postgresql databases. I have some expirience managing mysql databases with high load, but now we have to use postgresql. I want to know what are the ...
0
votes
1answer
48 views

Postgresql restore data from file [duplicate]

I have a tar archive with full backup of my CentOS filesystem with pg9.1 installed. How can I restore one database from it?
2
votes
1answer
50 views

Why write ahead logs in PostgreSQL are generated every second

PostgreSQL version 9.2 generates write ahead log (WAL) every second i.e. 60 WALs are generated in one minute. Is it possible to make them occur less frequently? Is it possible to increase the WAL ...
1
vote
1answer
140 views

pgpool replication not allowing md5 authentication

I have installed both pgpool and postgresql via apt. In pgpool.conf, I have made the changes necessary to use replication mode, as well as my two postgresql databases (currently all running on the ...
1
vote
1answer
77 views

What's better here - a single column or multicolumn primary key?

Let's assume you have a table groups and a table item. Each item belongs to exactly one group. It is an inherent part of that group. An item cannot exist outside of a group and it cannot be moved to ...
-1
votes
0answers
32 views

Blogs with real life experience in PostgreSQL [closed]

Can anyone point me to any blog posts or articles describing someone's real life experience with Scalability using PostgreSQL?
3
votes
2answers
237 views

Postgres log files not rotating

I have a postgres system with a hot standby server. They use the same config file. I've setup the log rotation to use log_rotation_size and log_rotation_age so that the master server is rotated every ...
1
vote
1answer
38 views

Increased performance from single statement, multiple row inserts?

I'm currently obsessing over bulk inserts via prepared statements with libpqxx. I am far from a database expert and even further when it comes to Postgres, but just thinking superficially, it doesn't ...
0
votes
1answer
81 views

pgpool2 setup on master-slave replication using postgreql 9.1

I have already setup 2 ubuntu server 12.04 LTS on my local machine using virtual box and is using the master-slave replication (postgresql 9.1). 192.168.0.109 = master 192.168.0.110 = slave my ...
3
votes
3answers
49 views

PostgreSQL 9.0 how to reclaim disk space after delete without rebuilding table?

Our PostgreSQL 9.0 Windows production server is running low on space. In our 100GB database, we have a large table containing TOASTed binary data. We have deleted some rows and need to return the ...
0
votes
1answer
28 views

PostgreSQL extending UPDATE query

I have the following update query to populate a table storing user stats users: int (pk) user_id date last_visit int (fk) local_site sites: int (pk) site_id site_stats: int (fk) site_id ...
0
votes
0answers
47 views

Lost all my Postgres database tables? [on hold]

I'm a novice using PostgreSQL on a local database that I created using Postgres.app on my Mac. My dbase included multiple related tables with ~50MB of data, and after restarting my Mac (system update) ...
0
votes
0answers
14 views

Postgresql not working: error

My Postgres was working fine on my ubuntu 12.10 before i installed postgres-xc and execute a command initdb for changing encoding. After that it started showing error like: psql: could not ...
3
votes
0answers
27 views

Is PostgreSQL or ElasticSearch/Solr the right tool for this kind of query?

Here is an example of the current PostgreSQL query: SELECT a.*, a.al_location <-> '(someLon, someLat)' AS d FROM al_app.al_activity AS a WHERE to_tsvector('simple', a.al_keywords) @@ ...
-3
votes
0answers
56 views

Fastest way to Restore 50TB DB [closed]

I am trying to find out if there other ideas as what the fastest way is to restore a 50TB DB.