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
0answers
12 views

Cannot connect to PostgreSQL database as 'localhost'

I am developing an Android application and I'm using PostgreSQL bundled with PostGIS. I want to use a local database for that but connecting via 'localhost' doesn't work, I have tried the alternative ...
0
votes
0answers
12 views

Best way to store a function map

I am building a site where data gets filtered through user defined functions to create an output. It is a requirement that the functions are represented in the database as formulas. For example a ...
1
vote
1answer
27 views

PostgeSQL 9.3: What is the difference between text and pg_catalog.text?

I have a classic 3-environments setting (dev, staging and production), each with its own RDS PostgreSQL 9.3. The client/server versions are psql (9.3.5, server 9.3.3). In order to keep the schemas ...
0
votes
1answer
27 views

PostgreSQL, UPDATE CASE statement uses huge amount of space

I am running a CASE statement on one of my tables and it consumes a huge amount of hard drive space that is never freed up even when i run VACUUM ANALYZE. Autovacuum is ON as well. I am using ...
3
votes
2answers
982 views

could not save history to file “/var/lib/postgresql/.psql_history”: No such file or directory

I'm following this tutorial to set up my postgresql db. http://inventtheweb.blogspot.ca/2012/05/install-postgresql-for-django.html After I finish running the CREATE DATABASE command and run \q I ...
3
votes
2answers
3k views

Freeing disk space after dropped database

I'm working on a dev system, and I have been restoring to a database, say "foo", that I'm using for dev purposes. As I'm working through the kinks, I've just been running DROP DATABASE foo. However, I ...
0
votes
0answers
11 views

PostgreSQL: Store hierarchial data and return a recursive result with full path data

Background: I am considering whether to use LTREE or Recursive CTE with Materialized Path. For storing data, I am deciding between HSTORE or JSON. Objective: I need to store a hierarchial data. Each ...
0
votes
0answers
38 views

ERROR: relation “name” does not exist

I am trying to import a postgresql database table sent to me in phpPgAdmin, I am following the instruction from this import database But after doing so, several error appear, I also tried to import ...
4
votes
1answer
238 views

Is there a First() aggregate function in postgresql that returns the exact same type as the input?

Full question re-write I'm looking a First() aggregate function. Here I found something that almost works: CREATE OR REPLACE FUNCTION public.first_agg ( anyelement, anyelement ) RETURNS anyelement ...
0
votes
1answer
539 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 ...
0
votes
1answer
75 views

mongodb on-premise: will it work?

We are planning to package MongoDB-PostgreSQL hybrid solution in our application that will be deployed on customer site on-premise. It will be packaged as a software virtual appliance. Our reason for ...
3
votes
1answer
53 views

PostgresSQL dynamic execute with argument values in array

I'm wondering if this is possible in Postgres: Best explained using a contrived example: create or replace function test_function(filter_param1 varchar default null ...
1
vote
3answers
62 views

PostgreSQL procedural languages overhead (plpython / plsql / pllua…)

I'm trying to find information about PostgreSQL user defined functions in procedural languages performance for real time tasks. How does they compare to builtin functions? Is there any difference ...
2
votes
0answers
45 views

UPDATE/DELETE performance on partitioned table

Hi I'm using table partitioning in my Postgres 9.3. I've notice that the DELETE and UPDATE queries are much slower when I'm doing them via the parent table. I see that the constraint_exclusion is ...
1
vote
0answers
18 views

Optimizing postgres row overlap constraints involving UUIDs and GIST

For various reasons all my tables have UUIDs as primary keys and I need to exclude duplicate rows where the combination of area_id, user_id, and finished_at <-> started_at window. The only way I ...
0
votes
1answer
19 views

Postgresql - Streaming replication - STONITH

Current situation: PostgreSQL, streaming replication Master failed, I created the trigger file. Slave is promoted to new master After the old master restarted successfully, I have to create base ...
0
votes
1answer
18 views

Dump all binary fileds in a table as files

I have a table in a postgresql database with a column of type bytea. I want to drop each binary entry as a file using the id as filename. What would a SQL query look like for this?
0
votes
2answers
46 views

Performance Benchmark - MySQL vs PostgreSQL [on hold]

this is my first question here in DBA. I wish to do a performance comparison between MySQL and PostgreSQL using same database on the basis of total time taken to parse + execute + send result back ...
-1
votes
1answer
71 views

Maximum limit for COPY FROM STDIN in postgres

May I know what is the maximum number of records that can be inserted. In my program, it works for around 20,000 file reading and inserting into db. But the total count is 400,000. When I try with ...
3
votes
1answer
140 views

Get list of characters in column

I have a database table (UTF-8) with a lot of names in different languages with lots of special characters. In another script I use these names and one part is to replace the special characters. To ...
31
votes
8answers
33k views

How do I find PostgreSQL's data directory?

I forgot how I last time started postgres (it was months ago) and I don't remember where the data directory is located at. The postgres command seems to require to location. I'm on MacOsX if that ...
0
votes
1answer
543 views

Configuring Postgres 9.2 streaming replication with Redhat Clustering Suite for High Availability

I'm in the process of configuring postgresql 9.2 streaming replication with Redhat Clustering Suite for high availability. I have 1 master and 1 hot standby configured to replicate the data from ...
0
votes
0answers
11 views

Is content of the pg_autovacuum saved when pg_dumpall is used to backup the database?

From the docs: pg_dumpall also dumps global objects that are common to all databases. (pg_dump does not save these objects.) This currently includes information about database users and groups, ...
0
votes
1answer
53 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
21 views

can I give permission to insert into view, but not to referred table?

Here I have a view in public schema referring to the table in private schema: CREATE OR REPLACE VIEW public.products AS SELECT products.id, products.product_id, products.title, products.company_id ...
3
votes
1answer
51 views

PostgreSQL CREATE INDEX memory requirement

I've got 6GB of RAM on my laptop and for a test I'm creating a 50mil-rows table in PostgreSQL 9.3. I then want to create an index on the table. The table and the resulting index together (or twice ...
0
votes
1answer
50 views

Reassigning surrogate keys?

I have a few tables with surrogate keys (SERIAL PRIMARY KEYs unique to each tables). These tables are used by other tables, with references to these keys. My usage of these is quite simple : select ...
0
votes
1answer
11 views

postgresql unable to login

I created a user named 'client', witch refuses to connect. Here's my client: CREATE ROLE client LOGIN ENCRYPTED PASSWORD 'md5d5bc32b75da65fe60067f501a4bb6665' NOSUPERUSER INHERIT NOCREATEDB ...
0
votes
0answers
30 views

How can I insert rows into a table from a select query that brings duplicate entries?

I am using PostgreSQL. I have a table with columns: tutor_id subject_id I want to populate this table with the result of the following select: select tutors.id, subject_id from courses_subjects ...
0
votes
1answer
22 views

Email open rate calculations in subqueries with postgres

So I'm relatively new to PostgreSQL, but here we go: I have a pgsql database that is receiving HTTP Post Email Events from my Sendgrid email server, and am trying to make a dashboard that displays ...
0
votes
1answer
22 views

Can any one Explain me What is the Use of Cascading Replication in Postgresql?

What are the advantages of cascading replication in PostgreSQL. I have done Testing On this With three nodes. M1---->S1----->S2 What is the Use if My master(M1) goes Down(failover). Where the ...
9
votes
1answer
215 views

Busy table is not getting vacuumed

We're using Postgres 9.2 on Windows to store low-frequency timeseries data: we're inserting around 2000 rows per second every second 24 hours, 7 days a week with no downtime. There is a DELETE that ...
1
vote
1answer
450 views

Tree structure hierarchical query sorting

I have the following structure of table. CREATE TABLE table1 ( serial_num integer NOT NULL, parent_num integer, parent_key text, key_ary_num integer[], level integer, rank integer, ...
2
votes
1answer
42 views

How to determine cost/benefit of adding an index?

According to Craig Ringer: While it's usually a good idea to create an index on (or including) your referencing-side foreign key columns, it isn't required. Each index you add slows DML operations ...
3
votes
3answers
78 views

How long to learn PostgreSQL?

I want to learn PostgreSQL and How to make the learning process efficient, but really don't know how long it would take even after googling my question. I used MySQL before and knew relational ...
-1
votes
0answers
9 views

Merge two databases, postgres [on hold]

I have two postgres databases, Consider the following situation: Database A: Table 1 Table 2 Table 3 Table 4 Table 5 Database B: Table 1 Table 2 I want to insert the same Table3, Table4, Table5 ...
0
votes
1answer
72 views

Implementing Permissions Database structure on a PHP site to restrict the Access in Multiple levels

I am working on a PHP site that shows the business of a Vehicle Showroom company in which we have 3 users as, Admin(Owner) = Here Admin Have all Access by default(View,Edit,Delete to all) Super ...
2
votes
1answer
270 views

PostgreSQL Change owner of all tables under a specific schema

I am trying to change the owner of all tables under the same schema in one command line. i.e: alter table schema_name.* owner to newowner Is there a way to accomplish that?
1
vote
1answer
273 views

How can I get data from broken PostgreSQL server?

I have installed CentOS on a virtual machine and installed the latest version of PostgreSQL server 9.3. I have added PostGIS extension and some data. For some reason, the PostgreSQL service now fails ...
1
vote
0answers
12 views

Removing a FAILED node from repmgr cluster

How do I remove failed node from a PostgreSQL cluster? postgres@db-prod-ms47ox-10-3-104-92:~$ repmgr -f /etc/repmgr/repmgr.conf cluster show Role | Connection String * master | ...
0
votes
2answers
6k views

Opening a .backup file for PostgreSQL

I'm going to warn you that whoever explains this needs to talk to me like I'm five years old, because this is something way, way beyond my level of expertise. In short, I have what I think is a ...
1
vote
1answer
907 views

PgPool 2 with HA Proxy

So, I'm looking to add high availability to a postgresql server. I've looked into some tutorials on the web but, haven't been able to find exactly what I'm looking for. E.g.: PostgreSQL ...
0
votes
1answer
262 views

pgpool2 not working on my Ubuntu i686 athlon i386 GNU/Linux

I am trying to implement replication and load balancing on my Ubuntu i686 athlon i386 GNU/Linux.for creating database clustures I have installed postgresql contrib 9.1.11 having initially database ...
1
vote
1answer
40 views

How to restrict access to current user record and its rights in postgres

Postgres 9 database contains additional information about postgres users: create table public.user ( user char(10) primary key, -- CURRENT_USER in postgres name char(30) ); and user roles; ...
0
votes
1answer
77 views

PostgreSQL replication with fsync disabled?

I need to run PostgreSQL in-memory (for performance reasons), so I intend to disable fsync, which means that no writes will be sent to the WAL. However, as part of my scheme to meet another ...
1
vote
1answer
435 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 ...
0
votes
1answer
27 views

how are passwords encoded in pg_shadow

How are passwords encoded in column passwd of pg_shadow? Doing a: select passwd from pg_shadow; I see values like the following: md52c92c858aa1fa12144f1dcbd4ca9c3a0 ... which, doesn't seem to ...
0
votes
1answer
38 views

Database Normal Form (financial statement)

I would like some advice on how to design the database for financial statement data which objectively addresses the tradeoffs between usability, performance, maintenance and adherence to normal form. ...
0
votes
1answer
31 views

PostgreSQL Role Configuration

I am using PostgreSQL 9.3. I am working with a friend of mine on a project on which both of us would need access to the same database and all of the permissions on every table. So I created a Role ...
0
votes
1answer
516 views

How to add FK on a column of composite type in PostgreSQL?

I have a table which contains a composite type and I am trying to connect a column of it to another table's PK. CREATE TABLE aaa (col1 SERIAL PRIMARY KEY); CREATE TYPE bbb AS (col2 INTEGER); CREATE ...