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
15 views

Change posgresql 9.3 slave roll password

I need to change the password on my slave posgresql server, because the person who set it up left the password the same as the password for the super user account on our other server. When I run ...
0
votes
1answer
20 views

High volume data aggregation

I need to aggregate incoming data and save the resulting aggregates to a table. A sample of the data is below. id,time 1967,2014-04-12 00:42:55+00 1967,2014-04-12 00:42:51+00 1972,2014-04-12 ...
0
votes
1answer
7 views

WAL archiving from a standby backup strategy Postgresql 9.3

I am trying to figure out if wal archiving from a standby is possible and a viable option for a backup strategy on Postgresql 9.3. The idea is to be able to take regular base backups and wal ...
0
votes
0answers
28 views

Is there a better First() aggregate function in postgresql?

Some context I have been working in a "homemade" backup system for my postgresql (with postgis extention) database. The database is used with a geographic information system software called qgis as ...
0
votes
0answers
13 views

Connecting Posgresql server using Pgpool

I am running two postgresql servers on two different linux machine and also running the pgpool-II-93 on the both machine.I simply want to check whether syncing between Databases at different machine ...
0
votes
1answer
28 views

What happens when we call pg_dump while users are still using the system?

We have a web application with PostgreSQL as our database and use celery background tasks for somewhat complex task. At the very beginning of this complex task we take a backup of the database using ...
0
votes
0answers
49 views

Adding additional condition significantly degrades performance

Have the following query: SELECT * FROM table_A INNER JOIN table_B ON /* conditions */ INNER JOIN table_C ON /* conditions */ INNER JOIN table_D ON /* conditions */ WHERE table_B.state = 'active' ...
0
votes
0answers
19 views

Tool for auditing and managing databse access control lists [on hold]

There is maybe a tool for auding privileges to certain objects in the postgres db, checking password security, checking or public privileges are revoked etc.? A simple script that generates report ...
1
vote
1answer
93 views

Difference between now() and current_timestamp

In PostgreSQL, I use the now() and current_timestamp function and I see no difference: # SELECT now(), current_timestamp; now | now ...
0
votes
1answer
42 views

Cannot install Postgres 9.3 on Linux Mint

I am trying to install Postgres 9.3.4 on Linux Mint 16 Petra. In a terminal window, I pasted: blah ~ $ sudo apt-get install postgresql-9.3 The following appeared on the console… Reading package ...
0
votes
1answer
54 views

Database design for small startup

For a small startup that doesn't have much expected traction in the very beginning. We are currently working with only one postgres database without replications and at risk of failures. I've done ...
4
votes
0answers
28 views

Postgresql JDBC Table Valued Parameters [on hold]

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 in PostgreSQL, if ...
1
vote
2answers
46 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 ...
2
votes
1answer
28 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
0answers
17 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
22 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
4answers
84 views

PostgreSQL 9.3 on Ubuntu Server 12.04 v.s. MS SQL Server 2008 R2 on Windows 7 Ultima

I have searched many articles in Google about the performance of PostgreSQL vs MS SQL 2008 R2 and found that many of those articles say the performance of PostgreSQL is better than that of MSSQL 2008 ...
1
vote
0answers
27 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
0answers
27 views

what values to set for the folowing PostgreSQL Variable [closed]

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 ...
1
vote
1answer
47 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
2answers
28 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 ...
0
votes
1answer
37 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
31 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
21 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'] = ...
2
votes
1answer
63 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
44 views

While importing 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
37 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
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
39 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 ...
2
votes
1answer
33 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 ...
0
votes
0answers
39 views

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

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 ...
2
votes
2answers
97 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 ...
1
vote
1answer
78 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 ...
2
votes
1answer
56 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
39 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
29 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 ...
3
votes
0answers
29 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) @@ ...
1
vote
1answer
43 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, ...
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
3answers
51 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
39 views

postgresql bigserial or sequence using jpa

I'm a java developer working with jpa, before to define the indexes in my entities i would like to known which one is faster o better to use?.
0
votes
1answer
65 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 ...
1
vote
0answers
19 views

Data Corruption on base backups created with wal-e?

I have streaming replication setup on Postgresql 9.1 with two machines on AWS EC2. The master has a cron job that does a daily base backup using the wal-e tool and uploading it to Amazon's S3 storage. ...
0
votes
1answer
48 views

Using dynamic column names in PostgreSQL

I am using PostgreSSQL 8.3. I want to execute this query: select COALESCE(col_fr,col,'Unknown') from my_table where id = 'abc'; Twist in the story is column name colum_fr should be generated ...
-1
votes
2answers
46 views

Select records for a day and a day - 1 day

From one table, I want to get the records from one column position when the created_at = Today and when the created_at = created_at - 1.day COALESCE(array_agg(DISTINCT pr.position)) AS position, ...
1
vote
1answer
33 views

How to Configure PostgreSQL Hotstandby Automatic Failover

So I have configured two postgeSQL servers to have hotstand by streaming, now my question is, how can I configure it so that when the master server goes down, the slave server will become the new ...
1
vote
1answer
18 views

What is the “last” data that get's backed up, when running pg_dump on a live server?

I'm wondering: If I start doing a pg_dump of a very large database (it would take hours), that is still running actively receiving writes, what is then the last data that goes into the backup? Is it: ...
1
vote
1answer
32 views

log_min_duration_statement setting is ignored

I am running Postgresql 9.1 on Ubuntu. Exact Postgresql version is 9.1+129ubuntu1 as my package manager shows. I have 2 databases that are actively in use and they are used from a remote server. I ...
5
votes
2answers
93 views

PostgreSQL, integer arrays, index for equality

I have a huge list of integer arrays (300,000,000 records) stored in Postgres 9.2 DB. I want to efficiently search these records for an exact match (equality only). I have heard of the intarray module ...
3
votes
1answer
29 views

What does “ERROR: failed to find parent tuple for heap-only tuple at (1192248,5) in table ”fruits“” mean?

After being bitten by the bug mentioned in the release notes of 9.3.4, I have realized that a very small part of my data is corrupt, after doing a failover. The bug showed it self as duplicate rows, ...