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
2answers
21 views

Can I perform a MAX over a pair of columns?

I would like to execute the following: SELECT person, MAX( (date, priority) ) FROM table GROUP BY person; It would return a person, date and priority row for each distinct value in the person ...
1
vote
2answers
26 views

Slow querys on billions-rows-table // index used

Since I'm a young developer and not realy skiled in using databases (PostgreSQL 9.3) i ran into some problems with a project, where i realy need help with. My project is about collecting data of ...
2
votes
0answers
16 views

PL/pgSQL - Indexes vs Collation vs Pattern Ops

I'm using PostgreSQL 9.3. Having already read articles and answers on DBA stackexchange: Why would you index text pattern ops on a text column PostgreSQL documentation: Indexes - Opclass Pattern ...
2
votes
0answers
14 views

Checking for multiple identical values in a Posgresql array

I have a simple table in Postgresql: CREATE TABLE data (id integer, values integer[]); INSERT INTO data VALUES (1, '{1,2,3,4,5}'); INSERT INTO data VALUES (2, '{1,1,2,3,4,5}'); INSERT INTO data ...
1
vote
1answer
19 views

Problem with LISTEN - NOTIFY mechanism in PostgreSQL

I'm struggling with PostgreSQL LISTEN - NOTIFY mechanism. I open two consoles and connect to my database using psql client: psql -U postgres test_db In the first console I subscribe to some ...
3
votes
0answers
19 views

PostgreSQL server problem in Windows XP

2014-10-01 09:22:49 IST LOG: database system was interrupted; last known up at 2014-09-30 18:30:24 IST 2014-10-01 09:22:49 IST FATAL: the database system is starting up 2014-10-01 09:22:49 IST LOG: ...
0
votes
0answers
8 views

What is the recommended pgpool mode?

I'm trying to determine which pgpool mode to use (http://www.pgpool.net/docs/latest/pgpool-en.html#config). In order of importance my requirements are: All nodes accessible via shared public ...
1
vote
0answers
17 views

Select all foreign key relationship chains from any set of potentially gapped table names

I am using this query to find all foreign key relationships: SELECT con.relname AS child_table, att2.attname AS child_column, cl.relname AS parent_table, att.attname AS parent_column ...
0
votes
1answer
12 views

Getting information on users payments via subscriptions

My current table db design looks like this : - User has one subscription - One subscription has many payments Table subscription has a user_id, which is FK to user table. Table payment has a ...
3
votes
2answers
32 views

How to save an interval of years in postgresql

I have to save an interval of years, like: id intervalYears 1 2014/2015 2 2015/2016 3 2016/2017 And so on. Those years are like accademic years, so the first year must be lesser then the second, ...
1
vote
1answer
20 views

use variable to determine the name of a column in the select in postgre

I'm trying create a update for a new structure of tables from a old table, but not using functions. I'm trying create a script to it. The old table is like this: -- old table (OldTable) name| col_a | ...
0
votes
0answers
9 views

Importing CSV into multiple tables using PostgreSQL

I have a very big CSV file with the following format: TAG,TIME,VALUE as an example row: footag,2014-06-25 08:00:00.0,3400.0 I used to import it easily inside PostgreSQL 9.3 using the following: ...
0
votes
0answers
5 views

when install pgpool is also needed install hearbeat and watchdog

I am trying to get the PostgreSQL services High Availability (HA) and then I am using pgpool-II. When I install and configure pgpool, the WATCHDOG section seems to doesn't works, then I have a ...
-1
votes
0answers
9 views

Error regarding SHMMNI parameter in your kernel durign the install of Postgres 9.3

During the install of Postgres 9.3 I get... FATAL: could not create shared memory segment: No space left on device DETAIL: Failed system call was shmget(key=1, size=36, 03600). HINT: This error does ...
0
votes
0answers
9 views

PgBouncer and Application Connection Pooling

I understand that PgBouncer is a dedicated component to handle connection pooling and my application would connect to PG server through PgBoucer. The connection pooling on PgBouncer side is strongly ...
1
vote
1answer
18 views

List distinct column values where those rows share other column values

I'm trying to write a query to detect possibly-invalid data in a PostgreSQL table. We have a table of city names like this: # `city_names` id | name | language | dialect | city_id ...
1
vote
2answers
22 views

PostgreSQL - summing arrays by index

I have an array of doubles column (double precision[]) in PostgreSQL that keeps half hour values for a day. So each array holds 48 values. I need an efficient query that is summing all this array ...
0
votes
1answer
13 views

How to restore postgreSQL schema dump to schema with different name

I know I can alter schema name after restoring but the problem is the name might already exist and I don't want to touch that existing schema. The dump type is "custom". So effectively I want ...
0
votes
0answers
10 views

Does PGStrom calculate relational comparisons?

I prefer index calculation and comparison be executed on the GPU. I have stumbled upon PGStrom. It seems one could infer that it will calculate index comparisons, but the claim doesn't seem to be ...
0
votes
0answers
11 views

could not connect to pgpool server

I am configure my pgpool server to allow access from: host all all 0.0.0.0 trust The service pgpool is running: user@pgpool:~$ sudo service pgpool2 status * pgpool-II is running. ...
1
vote
1answer
21 views

PostgreSQL complaining about shared memory, but shared memory seems to be OK

I've been performing kind of intensive schema dropping and creating over a PostgreSQL server, but now complains..: WARNING: out of shared memory ERROR: out of shared memory HINT: You might need to ...
1
vote
1answer
12 views

Connection pooling with 3 databases but 1 database as master for repmgr replication?

I'm using pgbouncer for connection pooling against 3 database on different servers, now I'm planning to use repmgr for replication, my question is, can I keep doing connection pooling on these 3 ...
0
votes
0answers
26 views

Using Configuration Management for DBA tasks?

We have a couple of Postgres 9.3 database servers in our system, all of them with their respective config files, databases, roles, role groups, permissions on schema/tables, extensions etc. We use ...
1
vote
1answer
61 views

PostgreSQL performance worse when adding CPUs

I ran into a strange behaviour when benchmarking PostgreSQL. The setup is like this: Virtual box VM, with 3 GB of RAM. The host has 16GB of RAM and 4 CPUs. Ubuntu 14.04, standard PostgreSQL 9.3 ...
0
votes
0answers
20 views

Postgresql: Domain of two values

I have to create a custom domain that is an interval between two years, but i actually need both years. For example: '2013/2014' '2015/2016' Is there a way to pack both years inside a single ...
0
votes
1answer
13 views

How to connect to an Amazon PostgreSQL database using SSL

I'm trying to log into an Amazon PostgreSQL DBS using SSL. I have all credentials but my psql version doesn't seem to support SSL. I've tried searching Postgres docs but all I see is how it has ...
1
vote
1answer
28 views

How much should I care about prepared statements for simple queries?

I wonder how much I should care about prepared statements (and therefore try to optimize my code) in case of pretty simple statements. The question originates from the fact that I recently noticed ...
1
vote
1answer
20 views

Format timezone to +-#### instead of +-##

I am curious if there is a way to configure Postgres (9.1+) to format the TZ part of a "timestamp with time zone" as +-####, just like PHP's date.format method does using "O". PHP Docs: O | ...
0
votes
1answer
14 views

Revoke delete from table for database owner

I am trying to revoke the DELETE privilege on a table for a database owner. I execute the command: REVOKE DELETE on my_table FROM database_owner; But when querying this via SELECT ...
1
vote
1answer
28 views

Replicating a postgres database for testing

I want to replicate a live server postgres database to our dev server for testing purposes but the problem is in inbuilt postgres replication feature the slave is always read only. Is there any better ...
0
votes
0answers
13 views

pgAgent does not run

I referred this to set up a scheduled job and did everything as it mentioned(ran the pgagent.sql as well) I need a very simple task to run periodically. In the 'Definition' tab in the steps, few ...
1
vote
1answer
14 views

Proxy authentication for PostgeSQL

The following seems likely to be a fairly common situation, but I haven't seen any solutions. I have a PostgreSQL database containing views that are specific to the $user, in order to restrict data ...
-1
votes
0answers
24 views

Get records that have associations in other tables [on hold]

I have multiple tables such as dataset_tb, dataset_tag_tb, user_dataset_access_tb. I need to get datasets that have a specific dataset_type value in dataset_tb, in which there exists a record in ...
0
votes
1answer
17 views

How the xlogs files travels form Master to Slave

I have some doubts about how the workflow proccess in PostgreSQL replication using archiving logs. If I have this configuration in Master postgresql.conf: archive_command = 'test ! -f ...
0
votes
2answers
28 views

for archive_command use an script rather than a command

I want to create a configuration to get a PostgreSQL HA. In my Master I want to configure a postgresql.conf file with this: archive_command = 'local_backup_script.sh "%p" "%f"' instead of: ...
1
vote
1answer
15 views

Does pg-pool-II support two phase commit?

When pg-pool II is used with sharding, what happens if I want to do a transaction which involves two nodes ? Does pgpool support two phase commit ?
1
vote
1answer
68 views

BitmapIndexScan vs IndexScan tuning

I have the following test case: CREATE SCHEMA IF NOT EXISTS long; SET search_path TO long,pg_temp,pg_catalog; CREATE TABLE long WITH (autovacuum_enabled=off) AS SELECT id, (random()*1000)::int AS ...
0
votes
0answers
32 views

Hardware Specifications [closed]

I'm having trouble determining what hardware to get to host a large (2-3TB) Postgres DB. The database will only have at most 5 or 6 users, and be able to output large queries that will span the whole ...
0
votes
1answer
23 views

PostgreSQL : drop column from view

I have a VIEW where I'm attempting to create an evolution script for, so I can add a column to it. That part works fine; column added just fine. However, the reverse does not work; remove that last ...
1
vote
2answers
27 views

Why wouldn't VACUUM ANALYZE clear all dead tuples?

We run a "manual" VACUUM ANALYZE VERBOSE on some of our larger tables after we do major DELETE/INSERT changes to them. This seems to work without issue although sometimes a table's VACUUM job will run ...
1
vote
1answer
15 views

Find the number of where statements that matched in postgresQL

Right now I have a query that looks something like this SELECT id FROM products WHERE products.details->'make' = ? OR products.details->'model' = ? OR products.details->'year' = ...
0
votes
0answers
20 views

Not able to create or modify tables using Oracle SQL Developer with psql driver

So I would like to use the Oracle SQL Developer for managing my postgresql database. Connecting to that database works fine with SQL developer 4.0.3. I am using this psql driver: JDBC41 Postgresql ...
0
votes
0answers
17 views

PostgreSQL is not installing correctly

I am installing postgreSQL in windows 7 64 bit system. The problem I am facing is that the setup is not finishing properly, the window showing installation is not terminating. The icons are visible ...
0
votes
1answer
26 views

Compare the same column on different dates

I have two tables project_key: project_id, key_id project_report: project_id, key_id, level, created_at I would like to compare the column level when created_at is now() and created_at is ...
2
votes
1answer
42 views

Combine a generated series with each row from a select

The below select is returning an array of all the projects owned by all my users. WITH user_projects AS (SELECT u.id as user_id ,COALESCE(array_agg(DISTINCT pa.project_id), '{0}'::integer[]) as ...
0
votes
1answer
14 views

How to change the mount point for a column in postgresql table?

This is my scenario I have a table t with following columns id int link varchar(500) name varchar(20) sal text In the link column we will store the location for the pdf files(mount point) ...
0
votes
0answers
6 views

“kind does not match” after failover

We are using pgpool-II 3.3.3 with 4 nodes of Postgres 9.3. At some point today 2 of the 4 nodes had errors and pgpool did a successful failover. When the 3rd node had errors pgpool also reported a ...
2
votes
3answers
48 views

Change table scan in query plan to seek

I have an ORM generated query (Django) running against a local Postgres 9.1.11 instance that looks up ~5 records from two specific match fields. Due to the nature of the EDI load program, I need to ...
0
votes
0answers
19 views

Postgres - Combine similar queries with extra where clause

I am trying to combine a number of fairly time consuming queries into one (if possible) The database contains race-track data that records the times for laps completed by drivers (or users here), the ...
1
vote
2answers
36 views

How to understand “object-relational”?

I can't understand why the document say "PostgreSQL is an object-relational database management system"?Can somebody tell me the reason, or give me some article about this question. Thanks a lot. ...