PostgreSQL 9.3 : 2013 release of PostgreSQL

learn more… | top users | synonyms

0
votes
0answers
23 views

While impoting 150 GB file on Amazon RDS, why connection is failing?

I am having Postgres database dump file of 150 GB on Amazon EC2 instance. While dumping the data on RDS from EC2 server I am getting error. The output of the command is as given below. It's giving ...
3
votes
1answer
29 views

What does “ERROR: failed to find parent tuple for heap-only tuple at (1192248,5) in table ”fruits“” mean?

After being bitten by the bug mentioned in the release notes of 9.3.4, I have realized that a very small part of my data is corrupt, after doing a failover. The bug showed it self as duplicate rows, ...
2
votes
0answers
87 views

Why does my table hold duplicate primary keys?

To my big (and worrying) surprise I just realized that my table with millions of rows, has a few handful of rows, where the primary key (ID) is a duplicate! I don't understand how this can ever ...
0
votes
1answer
37 views

Migrating Postgres from 9.2 to 9.3

I have 2 CentOS servers, one is running PostgreSQL 9.2 and the other, 9.3. I'm trying to migrate the database but I'm getting 'relation does not exist' errors. What I did was on the 9.2 server: ...
1
vote
2answers
35 views

Version control tool for postgreSQL [closed]

Can anyone suggest a windows based version control tool for PostgreSQL. Thanks and Regards, GP
0
votes
1answer
25 views

Postgresql: When using SSH tunnel, I receive the fe_sendauth: no password supplied error

I am SSH Tunneling to my postgreql server. I have previously successfully configured 9 + win XP dev PCs to connect to this postgresql server, those PCs still connect successfully. I am now setting up ...
0
votes
1answer
10 views

Suggested ways to route traffic between master / slave

I have multiple Postgres servers up, running in master / slave streaming replication mode. I was wondering what the suggested methods of routing write traffic to the master, and the read traffic to ...
5
votes
2answers
109 views

Is this temp table behaviour documented?

Query Language (SQL) and PL/pgSQL functions treat temp tables differently: begin; create table foo(id) as values (1); select * from foo; /* id ---- 1 */ savepoint s; create function f() returns ...
10
votes
3answers
280 views

Indexes for SQL query with WHERE condition and GROUP BY

I am trying to determine which indexes to use for an SQL query with a WHERE condition and a GROUP BY which is currently running very slow. My query: SELECT group_id FROM counter WHERE ts between ...
2
votes
2answers
48 views

How can streaming replication be kept lagged by a certain 'delay' time?

Postgres has had streaming replication since 9.0 and since 9.1 it is possible to pause and resume the application of the streamed WAL records using pg_xlog_replay_pause() and pg_xlog_replay_resume(). ...
1
vote
0answers
42 views

What does: ERROR: tuple offset out of range: 0 mean?

It seems (but I can't tell for sure) that after I added a postgis indexed column (USING gist) to my database last week, I have been seeing a lot of those errors: ERROR: tuple offset out of range: 0 ...
10
votes
3answers
382 views

Can IS DISTINCT FROM be combined with ANY or ALL somehow?

Is a postgres way of combining IS DISTINCT FROM with ANY or some other neat way of getting the same result? select count(*) from (select 'A' foo union all select 'Z' union all select null) z where ...
1
vote
1answer
23 views

Has my 'cluster' operation succeeded?

I ran this command: cluster verbose address using address_locality_lookup; And got this result: INFO: clustering "dba.address" using sequential scan and sort INFO: "address": found 0 removable, ...
2
votes
2answers
71 views

Postgres point() index not being used

\d aggregate Materialized view "public.aggregate" Column | Type | Modifiers ------------------+-----------------------------+----------- ...
0
votes
1answer
59 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?
0
votes
1answer
81 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
50 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 ...
1
vote
1answer
91 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 ...
1
vote
0answers
44 views

Fastest way to get the length of the intersection of two text arrays in PostgreSQL

This is what I am currently using: CREATE OR REPLACE FUNCTION array_intersect(a1 anyarray, a2 anyarray) RETURNS anyarray AS $$ select array ( select unnest($1) intersect select unnest($2) order by 1 ...
2
votes
1answer
39 views

What does “unpackaged” mean in PostgreSQL extensions?

I've read the docs and a few blog postings, but I still don't get what the "unpackaged" tag in an extension file name is for. When would I use it and not use it?
0
votes
1answer
116 views

Optimize PostgreSQL for a lot of INSERTS and bytea updates

What we have (software): PostrgeSQL 9.3 with base configuration (no changes in postgresql.conf) Windows 7 64 bit Hardware: Intel Core i7-3770 3.9 Ghz 32 Gb RAM WDC WD10EZRX-00L4HBAta Drive ...
0
votes
0answers
31 views

Create new user without typing current user password

On a VPS, I need to create a new user on PostgreSQL 9.3 so I have tried sudo -u postgres psql -c "create user new_user with password 'secret';" This works but it asks me for the current user ...
1
vote
1answer
160 views

PostgreSQL JSON field performance with large documents

How well is the Postgre JSON type optimized for large JSON documents? I am especially concerned about partial retrieval (e.g. the cost of getting the last N items of a JSON array or looking up one ...
0
votes
1answer
154 views

Postgres 8.3 faster than 9.3?

Our software product currently ships on Windows 7 with Postgres 8.3 as its database. On a busy site, there may be 24 automated systems generating 100 rows (x100 columns) per minute, with 3-10 human ...
3
votes
0answers
75 views

Storing and querying rolling data in PostgreSQL

I have a large quantity of weather model data being put into a PostgreSQL database. The machine has 8 cores and 16 GB of RAM. I'm running PostgreSQL 9.3 with PostGIS 2.1. Each table will have a ...
2
votes
0answers
48 views

Postgres 9.3 - deletes terribly slow for 10 minutes after dropping indexes/constraints

If I run a script which drops indexes (17 of them, CONCURRENTLY makes no difference except that without it I get the occasional deadlock), then constraints (20 constraints on 18 tables) and then run a ...
1
vote
1answer
94 views

Can't restore my distribution DB postgres 9.2 backup into my staging DB postgres 9.3

I keep getting this pg_restore: [archiver] did not find magic string in file header when i execute a pg_restore -Fc -U "username" -d "dbname" "filename".dmpon my staging DB. These DB are running on ...
0
votes
1answer
36 views

Postgresql Logging Questions

I'm seeking some help understanding my PostgreSQL 9.3 log file. (Note: maybe this should be multiple questions, they are all involve the same general topic - which is understanding my log file). In ...
0
votes
2answers
54 views

Does Postgres support stored column labels that can be queried?

I'm not a DBA but seem to recall that there was a SQL database that stored column labels (preferred column headings that can be printed on reports). Does Postgres support labels such as these?
1
vote
1answer
109 views

Fastest way to get current user's OID in Postgres?

I am thinking of storing the user's OID in the "owner" column of a table, so I don't have to do anything if they change their username. I understand one can use pg_has_role() with OIDs, so that's ...
0
votes
1answer
38 views

How to copy the postgresql's xlog files safely

I mean how to safely copy xlog files when postgresql is running? Any reply will be appreciated.
2
votes
2answers
109 views

How to get all roles that a user is a member of (including inherited roles)?

Let's say I have two Postgresql database groups, "authors" and "editors", and two users, "maxwell" and "ernest". create role authors; create role editors; create user maxwell; create user ernest; ...
1
vote
1answer
72 views

PostgreSQL (9.3) restore won't finish

I've been running a restore job on 38m row table for over 24 hours that doesn't seem to want to come to an end. When I check pg_stat_activity it tells me that the restore job is still running, and the ...
2
votes
1answer
282 views

How can I update a json element in postgresql json datatype

I can't figure how can I update an element in a postgresql 9.3 datatype. My exemple the db CREATE TABLE "user" ( id uuid NOT NULL, password character varying(255), profiles json, gender ...
2
votes
1answer
207 views

How to create an index on an integer json property in postgres

I can't figure out for the life of me how to create an index on a property of my json column which is an integer. I tried it this way (and also dozens of others) CREATE INDEX user_reputation_idx ON ...
0
votes
1answer
151 views

pg_upgrade 9.2 to 9.3 error

I'm trying to upgrade a PostgreSQL 9.2 database cluster to a 9.3 cluster on a new server. I've copied the old 9.2 cluster (using rsync) to /srv/data/postgres on the new server and want to convert it ...
6
votes
1answer
120 views

Why are the plans different if the queries are logically alike?

I wrote two functions to answer Day 3's first homework question from Seven Databases in Seven Weeks. Create a stored procedure where you can input a movie title or actor's name you like, and it ...
2
votes
2answers
1k views

How to turn json array into postgres array?

I have a field user that holds a json document that roughly looks like that: { name: 'foo', tags: ['foo', 'bar'] } What I would like to do is to turn that tags array into a concatenated ...
1
vote
1answer
82 views

Create constraint for stopping mass update to a table

I want to create a constraint so that if more than 5 rows in a table are getting updated with an UPDATE statement it should warn the user / block the query.
2
votes
1answer
280 views

Are there other ways to select a dynamic list of columns?

I need to let my users specify the list of columns they want to select. So far I know two ways of accomplishing that. 1. Using refcursors CREATE OR REPLACE FUNCTION selecttestwithcolumnlist( ticker ...
1
vote
2answers
209 views

How can I keep a result set without keeping the transaction open?

The following documentation describes how to see the refcursor returned from a function, here, like this: CREATE FUNCTION reffunc(refcursor) RETURNS refcursor AS ' BEGIN OPEN $1 FOR SELECT ...
1
vote
1answer
201 views

How to do a minor upgrade postgresql 9.3.0 windows to 9.3.1?

What is the recommended way to perform an upgrade from PostgreSQL 9.3.0 to 9.3.1 (minor upgrade) using the Enterprise DB built windows installer? Should I uninstall first or just install over the ...
0
votes
1answer
60 views

Insert a group of consistent item with foreign key but colliding with existing items

Is there a way to insert a group of items that are dependent but consistent between them with unique primary keys and foreign keys but that are colliding with items in database. For example, given a ...
1
vote
1answer
219 views

Restoring PostgreSQL 9.1.9 backup with 9.3.0 results in error [closed]

How can I resolve the following errors in 9.3.0: psql mydb < ~/mydb_2013-10-25.backup.tar results in ... ALTER TABLE ALTER TABLE ALTER TABLE ERROR: could not open file "$$PATH$$/2309.dat" for ...
0
votes
0answers
247 views

FATAL: no pg_hba.conf entry for host “::1”

I'm attempting to deploy my Rails 4 application (that uses postgresql) using Capistrano. When Capistrano attempts to migrate the database I get the error FATAL: no pg_hba.conf entry for host "::1", ...
1
vote
1answer
66 views

Get maximum from aggregated values in a query

I have a table details it has a column kills and a column player_slot and a column match_id. I want to find the maximum difference between the SUM of kills for player_slot 0-4 and 128-132. Can someone ...
0
votes
0answers
439 views

How to completely remove EnterpriseDB Installation of Postgresql on Ubuntu?

All, I'm trying to install/run PostgreSQL 9.3, but am receiving a multitude of errors which seem to point to a failed installation of postgresql from the enterpriseDB package. For example, trying to ...
2
votes
3answers
3k views

Why won't PostgreSQL 9.3 start on Ubuntu?

I have successfully installed PostgreSQL 9.3 from the APT repository on 2 VM's running Ubuntu 12.04 and 13.04...however, I cannot get it to install properly on my host machine running Ubuntu 12.04. ...
4
votes
1answer
149 views

Can the 'returning' clause return source columns that are not inserted?

Here's a minimal example of my real-world problem: create table t(id serial primary key, rnd double precision); of course you can return the inserted columns with a returning clause: with w as ...
6
votes
3answers
2k views

What can I do with the new json field?

PostgreSQL 9.2 introduced the json field type. Why and when should I use it? What benefits does it have over a text field? I thought there were new query options available, however I haven't seen ...