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)

3
votes
1answer
63 views

Postgresql 9.3 replication: Preventing wal-files from building up, if receiver goes offline

I have a streaming replication running between two servers. I just upgraded to postgresql 9.3 from 9.2. Earlier on in my 9.2 setup, I have tried that my slave server went offline due to a network ...
2
votes
1answer
41 views

Pg_upgrade failed - what does “re-initdb” mean?

My pg_upgrade command failed. During the upgrade it told me, that if things were failing after a curtain point (which they did) Then I should: If pg_upgrade fails after this point, you must re-initdb ...
1
vote
1answer
65 views

Postgres, levenshtein distance and nested queries

I have a DB Table with 3,000,000 rows or more like that: |ID|T4|T16|T64|TL where ID =INTEGER (PK) and T4,T16,T64,TL are text fields. Each one is larger in length than the previous, i.e., LENGTH(T4) ...
2
votes
1answer
112 views

pgBouncer works great but occasionally becomes unavailable

I'm running pgBouncer in front of a busy postgres 9 database. For most of the time it works fine. But every few hours I'll get an error email from my application with an exception from psycopg2: ...
1
vote
1answer
33 views

Postgres settings reported differently in pgsql

We are running PostgreSQL 9.2 on CentOS 6 and I am seeing the settings are reported differently when I run the show effective_cache_size; command vs select * from pg_settings where name = ...
2
votes
1answer
31 views

PostgreSQL 9.2; Altering a table to use another sequence

I've created a table like so: create table doki_data_item2 (like doki_data_item including defaults); but this new table uses the same sequence as the old table. So two questions: How can I copy ...
0
votes
1answer
53 views

Postgres EXPLAIN ANALYZE behavior

I want to benchmark performance of a particular complicated query JOIN for various values of primary key ID. Most previous approaches say to use EXPLAIN ANALYZE for the query in question and get the ...
1
vote
2answers
48 views

SQL Select query with postgresql

I'd like to find all rows if is shows even once a particular value with postgresql For example : id TIT_CODE CLI_NOM CLI_PRENOM CLI_ENSEIGNE 1 M. DUPONT Alain A 2 M. ...
0
votes
1answer
91 views

Choosing between single table and multiple table database scheme

I'm building an application which saves addresses in a PostgreSLQ 9.3/PostGIS 2.1.1 database. Currently I am trying to find an efficient database schema, so far I've come up with two that would ...
0
votes
1answer
61 views

Streaming replication between postgresql 9.2 and 9.3

Does anyone know if it's problematic to have a postgresql 9.3 slave setup to do streaming replication from a postgresql 9.2 master?
1
vote
2answers
88 views

To normalize or not to normalize for few distinct values

Assuming in a Postgres database, you have a table called party, which can have less than 5 well-defined party_types such as 'Person' or 'Organization'. Would you store the party_type in the party ...
2
votes
2answers
128 views

UPDATE table with another table data

I want to update the table car_check field fencing.(total 40 rows).I also use postgis function. I think it's a little difficult.Any suggestions? The code is the first carid example. UPDATE car_check ...
3
votes
1answer
132 views

Confused about load balancing and horizontal scaling in postgresql [closed]

Please correct me if I am wrong but I guess handling more requests and load by adding more machines or balancing the load between multiple servers is horizontal scalling. So, if I add more servers, ...
1
vote
1answer
41 views

PostgresSQL authentication error

I recently forgot my PostgreSQL 9.1 password on my windows 8 and it asks for password on pgAdmin III console. Can I retrieve the password or reset it?
5
votes
1answer
50 views

How to see amount of reusable space for a table

I had a huge table(about 300mil rows). After massive DELETE and VACCUUM table files have stopped to grow. That's exactly what I expected. But is there any way to see how much space became reusable?
0
votes
1answer
61 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 ...
3
votes
1answer
48 views

Non-overlapping rectangles constrained to a boundary

I am trying to model placement of parts on a circuit board. Without any meaningful constraints, my basic schema looks like this: create table part ( part_id bigserial primary key, name text ...
2
votes
2answers
74 views

Order of returned record with IN statement postgres

I know that the order of returned records is not guaranteed with the IN statement for Pstgres. For example if I do this: SELECT "users"."id" FROM "users" WHERE "users"."id" IN (13589, 16674, 13588) ...
2
votes
1answer
53 views

Postgresql 9.2.6 ignoring archive_command

I'm attempting to set up a 3-server chain by leveraging WAL-E. I've done this in the past with replication/wal segments and I'm attempting the exact same method, just with using WAL-E in between. My ...
0
votes
0answers
21 views

postgres database program to save sql templates and search where used it

I have a postgres database with tables and functions build using sql templates. And I would like to use a database program to save these templates and search where I used it. What i want to do is to ...
1
vote
1answer
37 views

Battery backed write cache and Postgres

I will be getting a SAN with a battery backed write cache for a new Postgres data warehouse and am not sure what settings to apply to make proper use of it. If the cache is enabled in the SAN is that ...
1
vote
1answer
27 views

constraint view CASE values

Below is a sscce to motivate the case. I keep a table of persons: CREATE TABLE person (name VARCHAR); ALTER TABLE person add PRIMARY KEY (name); INSERT INTO person (name) VALUES ('Bob'), ('Mike'); ...
0
votes
0answers
52 views

PostgreSQL Install Error

When I install the server for the first time, when almost finished it reports: (from log file "%temp%\bitlock_installer1376.txt") Loading additional SQL modules... Executing cscript //NoLogo ...
1
vote
1answer
43 views

Selecting distinct records

I have a user relation to address (1 to 1). So the address has two types which is a type column. One is the VerifiedAddress and the other one is the SearchAddress. So the user who had verified his ...
0
votes
0answers
27 views

Unable to exit a Greenplum SQL script

Is there any way in psql (Greenplum flavour) of exiting a script? I have tried with \q and \quit, e.g. \echo "Hello"; \q -- or \quit but I get: my_database> \i my_script.sql ...
4
votes
3answers
95 views

PostgreSQL: Extending database storage when disk is full

I have a database that takes about 60GB in my disk storage. And it doesn't alow to insert into database anymore. I have read the documentation about tablespaces link But It's like create space for a ...
1
vote
2answers
268 views

Very slow execution of a simple query

I try to create a report for my data, but it is really slow on a big table. The table structure is: CREATE TABLE posts ( id serial NOT NULL, project_id integer, moderation character ...
0
votes
1answer
82 views

PostgreSQL, storing encrypted data or encrypt database with pgcrypto - what is more secure? [duplicate]

I have two machines: client and server (a database server). I want to connect from client to server and manipulate data from database (insert, update, delete, select) using dblink. I would like to ...
0
votes
1answer
51 views

PostgreSQL dblink password encrypted or not?

I have two PostgreSQL servers: server 1: 192.168.0.1 server 2: 192.168.0.2 I want to connect to the database on server 2 from server 1. I do it like this: SELECT ...
0
votes
1answer
65 views

Postgres database migration “zero” downtime

I have a setup with a JBoss EAP server, postgres 9.1 database. I will soon update so I have two JBoss servers in a cluster. This is mostly to avoid downtime when doing application deployments. With ...
1
vote
1answer
78 views

Optimizing Postgres query

I've got a one to one relation from users to addresses table. Where one user can have one search address and one verified address. I've got two indexes on addresses table : Index on state field ...
2
votes
1answer
33 views

Understanding postgres reason for picking this query plan

I ran a query: select * from orderline where orderid = 12345 and status > 0 that gave me the following plan: Bitmap Heap Scan on orderline (cost=286370.00..531410.78 rows=76372 width=155) ...
0
votes
0answers
18 views

Changed password on Postgres but I still can log in with the old one [closed]

I changed my password via alter user, but can still log in with the old one. In the 9.1.6 version of postgresql I resolved this problem by killing all the processes through pg_terminate_backend, but ...
2
votes
1answer
80 views

2 B-tree indices OR 1 GiST index on tsrange — which will perform better?

I have a table which is storing reservation data using the columns starts_at & ends_at Whenever I'm querying the table to find overlapping reservations, I have an option of using one of the ...
2
votes
2answers
110 views

What is a valid use case for using TIMESTAMP WITHOUT TIMEZONE

There is a long and quite elucidating answer on the differences between TIMESTAMP WITH TIMEZONE -vs- TIMESTAMP WITHOUT TIMEZONE available in this SO post. What I would like to know is: are there ...
2
votes
2answers
93 views

Most performant way to fetch last record

I have a Postgres table Prices with the columns price (Decimal) product_id (Int) Prices get updated regularly and I keep old prices in the table. For a given product, the last price in the table ...
0
votes
0answers
54 views

PostgreSQL problems on Ubuntu 12.04

I'm having terrible problems with PostgreSQL initialization on my VPS. I followed several tutorials on this topic and nothing made my database server work. I followed these steps: sudo apt-get ...
2
votes
1answer
44 views

redundant foreign keys in PostgreSQL - are there any indexing benefits?

Note: this is not the same as this SO question which is about adding redundant information in the tables themselves. Does the final statement in the below series of statements buy me anything in ...
2
votes
1answer
87 views

Enforcing constraints “two tables away”

I ran into some trouble modeling an electrical schematic in SQL. The structure I'd like to capture is part ←────────── pin ↑ ↑ part_inst ←───── pin_inst where "inst" is short ...
0
votes
2answers
49 views

Configure postgresql recovery again to be slave

I completed a replication setup using PostgreSQL. Everything was working fine, so I proceeded doing a test by bringing down the main database and promoting the slave to be new master (via touch ...
4
votes
0answers
98 views

User locking tables without privileges

This is a restatement of a question asked on the GIS Stack Exchange here. Although it has GIS-specific elements it may be be a more general PostgreSQL effect. I have a PostgreSQL 8.4.4 database ...
0
votes
1answer
83 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
136 views

Restore postgres data/tablespace to new tablespace (at new mount point)?

I have a bunch of test/development databases which we currently refresh with production data as-needed using a NetApp filer's snapshot capabilities - we have a production slave with its datadir on a ...
1
vote
0answers
80 views

MATCH FULL vs MATCH SIMPLE

I've noticed a MATCH SIMPLE or MATCH FULL option in phpPgAdmin, but I can't find a description in the docs. How do they function? The default is set to MATCH SIMPLE.
0
votes
1answer
81 views

Postgres replication: Do I need to rsync pg_xlog files if I have archiving setup in master?

I am trying to replicate a master to slave, without shutting down my master. In the tutorial here: http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial, they recommend these steps: ...
0
votes
0answers
36 views

PostGres- How to loop in Table to update every record in Table

I am working on complicated problem, but I will simplify it to this problem. I have two tables A [ID, column1, column2, column3] B [ID, column1, column2, column3, column4] and i want to update the ...
0
votes
1answer
112 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 ...
1
vote
0answers
114 views

Postgres database zero down time production deployment

I need some idea about how I can deploy a financial application in production environment using PostgreSQL DB with zero down time. I have two servers in Master-Slave design. Currently I am giving ...
1
vote
1answer
93 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
31 views

Multiple source CASCADE DELETE behavior

I'm having trouble understanding Postgres's CASCADE DELETE behavior. If table_A REFERENCES table_B, and the column referenced could have multiple instances of the same value, will the table_A row be ...