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)

4
votes
1answer
675 views

What are the privileges required to execute a trigger function in PostgreSQL 8.4?

What are the privileges required to execute a trigger function in PostgreSQL 8.4? It seems that the privileges set to a role does not matter to execute a trigger function. I think I have seen some ...
1
vote
1answer
1k views

Connecting to postgres from windows to virtual machine

I have the following setup Windows 8 Oracle VM virtual box with arch Linux running on it Installed and configured PostgreSQL on Linux Setup the ports in virtual box so that 45432 port on windows ...
1
vote
0answers
554 views

How to configure pgpool for reasonable speed

I have a problem with pgpool II configured in master-slave mode with replication on slony. I have configured postgres databases on each server to run as fast as they can and this was verified by me ...
2
votes
2answers
2k views

PostgreSQL difference between VACUUM FULL and CLUSTER

I have a table with 200 GB of size occupied by data and 180 GB of size by the 6 indexes on it. It is 30% bloated, so I want to reclaim unwanted space occupied by it. It is clustered on job_id_idx ...
1
vote
2answers
123 views

Constraint on Composite Type

How can I create a constraint on a sub-field of composite type? Pseudocode create type axis( major_axis float, minor_axis float, angle float constraint angle_constraint check(angle ...
4
votes
1answer
1k views

Transpose two-dimensional array from n rows to 2 columns

Background Using PostgreSQL 9.1, so WITH ORDINAL (a 9.4 feature) is not available. Problem Looking to simplify the code that pivots a two-dimensional array. Code A working, overly-verbose example ...
1
vote
1answer
149 views

Index method for very few updates and many inserts

I am using Postgresql 9.1 with *pg_trgm* extension. I need to create an index on a text-based field. I do not need full-text searches, I use ILIKE queries to make my searches. I will use pg_trgm but ...
2
votes
1answer
1k views

Postgresql out of memory while trying to a request of ~500mb

I started getting out-of-memory errors on os postgresql-9.1 server running on a x64 Debian with 4GB of RAM, dedicated to postgresql. Top returns something like this, which seems that the problem is ...
3
votes
1answer
338 views

Group By primary key or DISTINCT increase query time over 1000x with limit

Also see http://stackoverflow.com/questions/17741167/hibernate-jpa-improve-performance-of-distinct-query but I realized this is mainly a PostgreSQL issue. My application uses a 3rd party extension to ...
0
votes
1answer
237 views

How to real-time sync local Postgres instance to Cloud Postgres

I have a local postgres database (9.2) running on Ubuntu that is constantly being written to by an application capturing sub-second data. (99.9% of the transactions are inserts). I also have a ...
1
vote
2answers
93 views

Using an index for both uniqueness and fast lookup?

Right now I have a postgresql 8.4 database set up for players in a multiplayer game. I want the username column to be unique. I also want to be able to lookup a player by username quickly. Here's the ...
2
votes
1answer
77 views

Why does PostgreSQL require its own user/group for installation?

When installing PostgreSQL via MacPorts (and I assume via other means too), a postgres:postgres user/group is created. Are there any reasons why this user/group is needed?
0
votes
1answer
129 views

PostgreSQL - Date added row metadata

Is there a means of differentiating rows added after a certain date without explicitly storing that information as a column item? I working with a database that is constantly being filled with ...
4
votes
3answers
25k views

How do I insert a row which contains a foreign key?

Using PostgreSQL v9.1. I have the following tables: CREATE TABLE foo ( id BIGSERIAL NOT NULL UNIQUE PRIMARY KEY, type VARCHAR(60) NOT NULL UNIQUE ); CREATE TABLE bar ( id BIGSERIAL ...
4
votes
2answers
3k views

How to choose a collation for international database?

I'm designing a database which will store data in different languages (using UTF-8), so I think the best way to display the queries results is ordering it according to the user's language during the ...
-1
votes
0answers
151 views

Postgres database locked up [closed]

I was running a process to update a bunch of rows in postgres database and it locked up. Now I can't select anything out of it. None of my processes are "idle in transaction" when I execute ps ...
3
votes
1answer
210 views

Inconsistent query execution times using trigram indexes?

I have a table residences... I installed trgm: create extension pg_trgm; After adding trigram indexes to both grp and name columns using: CREATE INDEX residences_name_trgm ON residences USING GIN ...
2
votes
1answer
223 views

SPI postgresql - insert data into table from postgres.c

I'm working inside postgres.c (inside exexc_simple_query) of postgresql 9.1 (line 1094 of http://doxygen.postgresql.org/postgres_8c_source.html#l00829 ). I need to insert some query information in a ...
4
votes
1answer
1k views

How do I get the aggregate of a window function in Postgres?

I have a table containing a two columns of permutations/combinations of integer arrays, and a third column containing a value, like so: CREATE TABLE foo ( perm integer[] NOT NULL, combo integer[] ...
6
votes
1answer
428 views

Optimizing PostgreSQL for transient data

I have several tables with 100-300 columns of integer types each, that hold highly volatile data. The datasets are keyed by one or two primary keys, and when refresh occurs, the whole dataset is ...
1
vote
1answer
119 views

Dump PostgreSQL without DROP DATABASE

I want dump a database, but, without DROP DATABASE, and CREATE DATABASE instructions, in .backup / .sql (generate file). Actually I use this command: pg_dump --format=c --no-privileges --no-owner ...
2
votes
4answers
282 views

PostgreSQL : Restrict (another) superuser from accessing database

I'm new in PostgreSQL and looking to find if this is possible. There are two superusers, 'postgres' (which is default superuser from PostgreSQL) and 'super2'. Superuser 'super2' creates a new ...
4
votes
2answers
1k views

Have Postgresql accept 1 and 0 as true and false for boolean

I have a large file of dumped sql data to load in to postgresl (600mb+). In that dump, fields that are boolean true and false are expessed as 1 and 0 without quotes. Trying to load them in to ...
3
votes
2answers
596 views

Why does Postgres generate an already used PK value?

I'm using Django, and every once in a while I get this error: IntegrityError: duplicate key value violates unique constraint "myapp_mymodel_pkey" DETAIL: Key (id)=(1) already exists. My database ...
1
vote
1answer
97 views

Postgres WAL logs— point in time recovery with (time) gaps in the logs?

I'm setting up continuous archiving/ point in time recovery on Postgres and I've noticed some odd behavior. Here's the sequence of events: Save a base backup Archive WAL logs during normal DB ...
0
votes
1answer
44 views

Postgresql: No data left on drive, how can I wipe it and start over?

I have a system with a non-critical postgres database that was unmonitored and consumed all available space on its drive. The OS is unaffected so I am free to delete files. I would like to just ...
7
votes
2answers
3k views

How to do incremental/differential backup every hour in Postgres 9.1?

Trying to do an hourly hot incremental backup of a single postgres server. I have the following setup in postgresql.conf: max_wal_senders=2 wal_level=archive archive_mode=on archive_command='copy ...
4
votes
1answer
1k views

How to properly index hstore tags column to faster search for keys

I imported a large area of OpenStreetMap's planet.osm file into a postgresql database. The database contains a table called nodes. Each node has a geometry column called geom and a hstore column ...
-1
votes
2answers
206 views

Find records in same table with different company id but some other same values [closed]

I have subscriptions table that looks roughly: table subscriptions id (auto generated id) company_id city state subscription_date I would like to find records that: A) are of different company ...
3
votes
1answer
112 views

Streaming replication setup, sane setup?

Not being a DBA as main profession, I would like to know if the following assumptions are true. I have been searching the net for days and I think I have understand it correctly, but I would like to ...
2
votes
2answers
2k views

TOAST Table Growth Out of Control - FULLVAC Does Nothing

Recently, I've had a PostgreSQL 8.2.11 server upgraded to 8.4 in order to take advantage of autovacuum features and be in line with 30ish other PGSQL servers. This was done by a separate IT group who ...
1
vote
3answers
2k views

Bulk update of all columns

I am wondering if PostgreSQL has an update query somewhat like their insert values syntax. I have an updated set of data in this form currently: INSERT INTO ...
-1
votes
1answer
100 views

PostgreSQL select optimization

Can you please explain, how I can optimize select like this: SELECT * FROM calls WHERE id_temp % 5 = 0 LIMIT 300000 This select is working on table with 50 millions of records. Thanks a lot and ...
0
votes
1answer
175 views

Get old database off external hard drive

My hard drive crashed yesterday, luckily I had a back up. I didn't restore from backup though cause I needed a fresh system anyways. However there was a development database I would like back. Is ...
1
vote
3answers
761 views

What are the valid formats of a PostgreSQL schema name?

I can't seem to find documentation that describes the valid formats of a PostgreSQL schema name. I know that a schema name cannot: start with a number have spaces start with pg_ What else? Where ...
-1
votes
0answers
643 views

Can't connect to my Postgres databases [closed]

*** THIRD AND LAST UPDATE *** Excuse me very much, the error was highly stupid: I modified start.conf and changed it to manual. I thought that it was related to the start of the service at init, ...
5
votes
1answer
379 views

PostgreSQL: DBLink weird permission/connection error

The goal is to (1) create a connection, (2) return a view of another database, and (3) close the same connection all to be stored in a view (no stored procedure or embedded password). I came up with ...
0
votes
1answer
71 views

SQL Server fsync Options

PostgreSQL has the option to turn off fsync and synchronous commits (http://www.postgresql.org/docs/9.1/static/runtime-config-wal.html). Does SQL Server has this option somewhere?
7
votes
2answers
781 views

Convert units of measurement

Looking to calculate the most suitable unit of measurement for a list of substances where the substances are given in differing (but compatible) unit volumes. Unit Conversion Table The unit ...
0
votes
3answers
322 views

PostgreSQL not starting correctly, is it repairing itself first?

I never saw that problem before. I had problems and many PostgreSQL processes were stuck so I killed them with a -KILL... When I tried to restart, it says that it cannot restart, but the daemon ...
0
votes
1answer
57 views

Wrong return results

I'm trying to grab all the rows that have a risk of critical or high, with the discription or synopsis or solution or cve like password. But it keeps showing all rows not just rows with a risk of ...
0
votes
2answers
252 views

Is it possible to build an UNDO framework for postgres?

I was thinking of a table which would automatically log all transactions made to other tables and the command to undo that modifications. So every time you issue an UNDO() command you would read the ...
0
votes
0answers
222 views

phpPgAdmin does not see databases

When I go to databases in phpPgAdmin it says that there are 0 databases. Yet, if I run SELECT datname FROM pg_database it displays all databases OK. I would like to be able to 'explore' tables and ...
5
votes
3answers
3k views

Postgres Write Performance on Intel S3700 SSD

I'm not seeing the Postgres write performance increases I thought I would with a single SSD vs a hardware RAID 10 array of (16) 15k RPM SAS drives. I have a Dell R820 with a PERC H700 hardware RAID ...
0
votes
1answer
154 views

pg_upgrade fails with lc_ctype cluster values do not match

I'm upgrading my PostgreSQL version 9.1.4 database to version 9.2.4. Both the old and the new version are the bundled versions of postgresapp.com for Mac OS X. When trying to upgrade the database I ...
1
vote
1answer
752 views

Why is Postgres on 64-bit CentOS 6 significantly slower than Postgres on 32-bit CentOS 6

We have some Postgres + PostGIS applications that run well on CentOS 6 32-bit machines. We've recently been testing them on CentOS 6 64-bit machines, with similar configuration (all our machines are ...
1
vote
1answer
377 views

How can I speed up PgAdmin III Queries?

I've been noticing that PgAdmin III isn't as responsive as I expected it to be. For instance a query to select * ... from a table containing 20,397 rows takes 19.531 seconds in PgAdmin III and 7.383 ...
1
vote
1answer
844 views

Check if postgresql database is exists (case insensitive way)

Is there a "elegant built-in" case-insensitive way to check if db is exists? I've found only SELECT datname FROM pg_catalog.pg_database WHERE datname='dbname', but this is a CS check. The first thing ...
0
votes
1answer
305 views

Postgresql table with one integer column, sorted index, with duplicate primary key

I want to have a table in PostgreSQL with these properties: One column with an integer Allow duplicates in this column. Duplicates will be rare. Duplicates have no meaning logically and will be ...
2
votes
1answer
322 views

Cannot connect to server. Too many symbolic links. Postgres Error [closed]

I get this error when I try connecting to a PostgreSQL server: psql: could not connect to server: Too many levels of symbolic links Is the server running locally and accepting connections on ...