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

PostgreSQL Failover strategy

I'm lost when it comes to choose the failover technology for my postgresql database. The options I currently see are: PG Cluster Streaming Replication Warm Standby (log shipping?) Hot Standby Is ...
1
vote
2answers
64 views

In PostgreSQL is there a way to rank/weigh columns so as to order the results?

Let's say I am searching through three text columns. I don't just want results that match a given word or phrase, but I also want to weigh them (column A > column B > column C) - thereby ...
0
votes
2answers
148 views

Moving a Postgres database from standalone local DB to Amazon RDS

I have a working Ruby on Rails 4 app running locally on my Mac. I'm running Postgres locally. I want to move the database (and only the database, not the whole app) to Amazon RDS Postgres. What is ...
5
votes
1answer
165 views

If PostgreSQL starts after copying data, is the data ok?

I'm copying the data for a PostgreSQL database, that is, /var/lib/postgresql, from one server to another. The servers are identical except for the fact that one is 32bit and the other one is 64. I ...
2
votes
2answers
102 views

Optimize a query on two big tables

I have a very important query in my system that is taking too long to execute due to huge amount of data on tables. I'm a junior DBA and i need the best optimization I can get for this. Tables have ...
3
votes
1answer
55 views

How can I achieve clustering of rows without the exclusive lock and logging overhead of the `cluster` command?

The CLUSTER command on a big table can take a long time, and blocks both reads and writes to the table while it runs. I don't need the data in my table to be strictly sorted in index order, I just ...
0
votes
1answer
47 views

Restore postgres in command line on ubuntu failed

This question may be asked many times. We are trying to move a postgres db from windows (psql 9.3) to ubuntu runing postgres 9.3. Here is what we did: In windows, create backup for db cis with ...
5
votes
1answer
41 views

Is there a configuration setting for how many pages ANALYZE will scan?

Is there a setting that controls how many records/pages are scanned by the PostgreSQL ANALYZE command? It looks like by default it scans 30,000 pages and 30,000 records. The PostgreSQL Server ...
0
votes
0answers
27 views

pgAdmin Slony Creation Scripts

I have installed pgAdmin 1.18.1 but whenever I am trying to create a new cluster using Slony-I, it is always saying that it is missing some scripts. I have copied some .sql scripts from my Slony ...
0
votes
1answer
32 views

Easy way to replace an YAML array of IDs with strings from a joined table

I have a database full of camp data. Each camp has many campers and has many camp_weeks. In the table of campers, there is a YAML encoded array of IDs for the camper's camp weeks. The project ...
0
votes
1answer
42 views

Why does 'plpgsql' not appear in the pg_extension table?

I have two Postgres 9.1 installations. One works properly, the other does not. On the working installation: dc=# select * from pg_extension; extname | extowner | extnamespace | extrelocatable | ...
0
votes
0answers
47 views

scheduled job using pgagent in postgresql doesnt run

I am running postgresql 9.1 on linux ubuntu on Oracle Virtualbox. I have installed pgagent which I am trying to use to run scheduled jobs created through pgadmin III. For testing, when I run a ...
2
votes
1answer
47 views

Does postgres efficiently re-use space from deleted rows?

From the docs: In PostgreSQL, an UPDATE or DELETE of a row does not immediately remove the old version of the row [...] But eventually, an outdated or deleted row version is no longer of interest ...
1
vote
2answers
115 views

When normalizing a relational database, should multiple “type” tables be combined into one?

Before making substantial changes to the content, functionality and design of my website (I'll be refactoring everything, almost a complete rewrite), I'm setting up a new PostgreSQL database to hold ...
0
votes
1answer
48 views

Index creation before or after loading data

I have a situation where I need to create a table in Postgres and add approximately 3 million rows. Currently I am adding an index to one field after all the data is loaded, but I was wondering ...
0
votes
0answers
15 views

Connecting to postgres server from remote client gives error

I need advice of the following please. I can login to PGAdminIII from my workstation and read/write to my database. However trying to login from the command line gives me an error. After entering ...
0
votes
2answers
38 views

Thai and English in a postgresql

I have a postgresql DB with Thai and English values/strings in several tables. Currently I have the following settings | Encoding | Collate | Ctype | | UTF8 | en_US.UTF-8 | en_US.UTF-8 ...
1
vote
1answer
33 views

RANGE clause error within window function

I'm trying to use postgres' RANGE clause within a window function to dynamically set the window to the past 4 weeks not including the current date. Here is my attempt at it: SELECT ...
2
votes
1answer
98 views

Using PgBarman for PostgreSQL 9.3 backup

I'm setting up a backup strategy for a PostgreSQL 9.3 db. My job includes: take db backups every day/week/month use a Synology NAS as remote backup device I'm thinking of using Postgres ...
0
votes
1answer
49 views

Postgres database dump and restore on different database [closed]

I have two Postgres databases on the same server, which have the same schemas. The goal is to have DB1 as the production and DB2, as the database that will receive all the data that is migrated from a ...
2
votes
1answer
74 views

Could not open file “pg_clog/0000”: No such file or directory

My local PostgreSql 9.2 database won't start anymore this morning. I am on Windows 7. Yesterday, I performed a Windows Update before going to bed. I have checked the log and found: 2014-05-28 ...
1
vote
0answers
46 views

Any experience with cstore_fdw?

It looks like there is a (finally) an open source columnar and compression extension for Postgres. I wonder if anyone had any experience with it yet? I've worked with Greenplum for years, but I've ...
1
vote
1answer
67 views

Decrease WAL file size for backup

I'm setting up a backup strategy based on WAL files archiving and transmission via rsync. As DB activity will propably be very low (less than 100 inserts/updates/deletes per day), at least in the ...
0
votes
1answer
69 views

pgAdmin on a fresh OS X Server installation

I know for sure postgresql is running (checked with ps ax), but when I install pgAdmin and try to make a server connection to localhost I get this error: Server doesn't listen The server doesn't ...
3
votes
1answer
115 views

How do I decompose ctid into page and row numbers?

Each row in a table has a system column ctid of type tid that represents the physical location of the row: begin; create table t(id serial); insert into t default values; insert into t default ...
3
votes
1answer
54 views

Can Postgres synchronous replication stall a cluster if secondary/standby crashes?

In a setup with Postgres synchronous replication, let's say one of the secondary/standby machines crashes, will that lock/halt the master? That is, since the Postgres master always waits for ...
1
vote
1answer
49 views

What is the meaning of WAL file name?

We know WAL file locate in the $PGDATA/pg_xlog directory, but I don't know the meaning of WAL file ,such as a WAL file which named "0000000A00005283000000E0", I see some's blog say WAL file name ...
1
vote
0answers
55 views

Does a serialized transaction affect rows written after begin?

I'm trying to determine exactly how a SERIALIZABLE transaction affects rows written after the transaction has begun. I'm using PostgreSQL 9.2. For example, in one of my serialized transactions, it ...
1
vote
0answers
45 views

appending 2 tables based on common columns in Postgresql 9.3

I have 2 large tables that I need to combine into a single table--for statistical analysis. The two tables have some variations in column named, otherwise I would just use an INSERT statement. So I ...
7
votes
1answer
79 views

How do data checksums interact with streaming replication?

Data checksums are a new feature introduced in 9.3, and: there is a new GUC parameter "ignore_checksum_failure" which will force PostgreSQL to continue processing a transaction even if corruption ...
0
votes
2answers
33 views

Get distinct results based on column and satisfy condition

I have the below select which is selecting from a table with the columns: id, project_id, keyword_id, position, Data example: i, p_id, k_id, p 1, 1, 1, 4 2, 1, 1, 5 3, 1, 1, 6 5, ...
0
votes
0answers
34 views

COPY TO .csv and add quotes to header in PostgreSQL

I use the following in the command line \copy (select id, pid from table1) to '/path/to/file.csv' with delimiter ';' CSV HEADER; Everything works fine. But I want the header's string to be quoted ...
0
votes
0answers
48 views

How to avoid locking problems while disabling/enabling triggers in a PostgreSQL function?

Whenever I try to disable a trigger from within a function, I get following error: ERROR: cannot ALTER TABLE "datace" because it is being used by active queries in this session It seems logical ...
1
vote
1answer
34 views

Is there a way to define macros/alias in psql?

It is somewhat annoying to type EXPLAIN (ANALYZE, BUFFERS, VERBOSE) in psql tool every time you tune queries. So, is there a way to define an aliases (autocompletable ones would be very nice) in psql ...
0
votes
1answer
137 views

Postgres: How to insert row with autoincrement id

There is a Table "context". There is an autoincrement id "context_id". I am using sequence to retrieve the next value. SELECT nextval('context_context_id_seq') The result is: 1, 2, 3,...20.... But ...
0
votes
1answer
74 views

UPDATE Query replacing string primary key taking days to resolve

I'm working with a DB (not designed by me) that had the primary key set to a 47 character length string, which is causing problems due to the fact that the table has over 20 million rows, and this ...
5
votes
1answer
124 views

HStore vs. multiple tables with inheritance - do I have a good use case for HStore?

My broader question here has to do with when it is appropriate to use HStore vs. multiple tables vs. one table for storing document-like objects. Now, for my localized example: I’m designing a ...
0
votes
1answer
32 views

Postgresql database backup (and restore) from two servers to third storage place

I have two server machines with PostgreSQL: (A) is version 9.0.15 and (B) version 9.2. I wish to make backups of the databases stored in (A) and (B) - and be able to do restore if needed too! - to a ...
1
vote
1answer
74 views

Conditonally create temporary table

Invoking the following SQL leads to a warning 'column "s" has type "unknown"' which I can understand. What I'm trying to accomplish is to conditionally create a temporary in preparation of running a ...
1
vote
1answer
58 views

INSERT from a SELECT combined with a single value

I have this query that returns several rows of item_id: select item_id from properties where name like 'body'; And I have the second one that returns 1 row of tag_id: select id from tags ...
2
votes
1answer
56 views

Why is vacuum at a critical level in PostgreSQL when I'm running autovacuum?

I just checked the state of vacuum in my PostgreSQL database and it's at a critical level: $ check_postgres --action=last_vacuum POSTGRES_LAST_VACUUM CRITICAL: DB "postgres" DB: postgres TABLE: ...
2
votes
1answer
51 views

Postgresql AUTOVACUUM ANALYSE parameters for a specified table

I would like to set autovacuum parameters for a specified table. My problem is that AUTOVACUUM ANALYSE on a small table takes way to long to complete. This table has only 2 columns (including the ...
0
votes
1answer
29 views

Restricting Insert and Update to functions

We have a function in postgresql that inserts some rows in a table and updates some other rows based on an input provided by the user. Is it possible to somehow execute the function without giving ...
0
votes
0answers
29 views

Incremental backup of select PostgreSQL databases

There is lots of information on how you setup archiving by backing up WAL segments (and in fact I'm currently doing this successfully). However we have a lot of databases in our cluster (one per ...
0
votes
1answer
48 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 ...
0
votes
0answers
22 views

How can I figure out what service is trying to connect as root?

In my postgresql log I see this from time to time: 2014-05-20 12:34:03 CEST FATAL: role "root" does not exist I would not expect any of the services that I have configured to connect as root. How ...
0
votes
1answer
81 views

Postgres live backup

Goal: Maintaining a constant live backup of a postgres cluster. In case of cluster failure, backup/Secondary will contain most up to date view of Primary cluster. This is not a hot standby ...
0
votes
0answers
35 views

PostgreSQL manual way of sharding like behaviour

I've a main server with low space available and good internet connection that has a postgres database in production for a zabbix system. Also, I've another secundary server plenty of space but with ...
0
votes
0answers
82 views

Postgres 9.3 64 Bit Windows 7 and 64 bit Postgres install - cleared password no longer connects

Originally I allocated a password to the postgres database, but for some stupid reason the servers are usually setup with a blank password. I then assigned it a blank password in PGAdmin III, and it ...
2
votes
1answer
51 views

How to create a role that cannot create or alter a table?

I want to create a role named manager in postgresql . This role can update, select, delete and insert data in all tables but users that belong to this role cannot create a table nor modify the schema. ...