PostgreSQL is an enterprise class, open-source, object-relational database management system (ORDBMS) available for all major platforms including Linux, UNIX, Windows and OS X. Please mention your exact PostgreSQL version when asking questions.

learn more… | top users | synonyms (1)

0
votes
1answer
193 views

What database do most mobile start ups use? [closed]

mongodb? MySQL? PostgreSQL? If someone would add pluses and minus, let me know. Why I ask: I am a mobile startup. I need a database that supports spatial indexes. The spatial index must be able to ...
3
votes
2answers
9k views

How do I copy databases from Postgres 8.4 to Postgres 9.1?

My trac server recently started having issues. It was running a very outdated version of Ubuntu, and I was unable to properly use apt-get to correct the issues I was having. So instead I backed up the ...
2
votes
3answers
7k views

Starting postgresql service and specifying data directory

I have recently installed pg 8.4 on Ubuntu 10.0.4 using apt-get install. It installed pg as a service which starts ehenever the machine starts. However I have created a db cluster in a specific ...
3
votes
2answers
5k views

Tool for Reverse Engineering of PostgreSQL Database on Linux (Ubuntu)

Please suggest a tool to reverse engineer a PostgreSQL DB into an entity-relationship-diagram (ERD) or equivalent ?? Ideally, I'm looking for a simple ERD or UML class diagram in a format that is ...
4
votes
1answer
647 views

timelines and history files PostgreSQL 9.1

What is the purpose of timelines, history files, and the setting 'recovery_target_timeline' in recovery.conf? The vague understanding I have from the PostgreSQL 9.1 documentation is when the slave ...
1
vote
2answers
192 views

Perf of query of large table by date?

I have a table with some sensor data in it which grows every minute with a new measurement for that specific sensor. Something like: entry_id (pk), sensor_id (fk), measurement_value, created_at I ...
5
votes
1answer
363 views

Database Exceptions with Jetty 8.1.0 with BTM

We are running Jetty 8.1.0 with BTM 2.1.2. We are using Postgres as our DB. Everything works great except that when we run any query with a condition where sometable's primary=null, the server loses ...
2
votes
1answer
2k views

postgres composite index design

In my rails application using the Postgres database, I have a table called tw_schedules which belongs to a scenarios table (one scenario to many tw_schedules). In addition to the scenario_id foreign ...
4
votes
4answers
4k views

Passing arguments to psql

I'm running a plpgsql script in Postgres 8.3 - I would like to pass arguments to this script via psql. I'm currently executing the script like: psql -d database -u user -f update_file.sql I came ...
1
vote
1answer
395 views

What is the “Data partitioned, Shared-Nothing, Parallel Database” solution for PostgreSQL ? [closed]

I was looking for a open source parallel database solution. It seems Postgres-XC is a viable solution. However, I don't need the replication. In this case, is there any better solution towards read ...
3
votes
1answer
663 views

is my postgresql-server thread-safe?

before 9.0 i had to compile my postgresql-server with "--enable-thread-safety" for http://www.bacula.org since 9.0 the config-paramater is renamed to "--disable-thread-safety". The "PostgreSQL ...
0
votes
1answer
521 views

Can't get past password lock on fresh install of postgreSQL

I feel really dumb writing this, I wanted to have a mess around with databases so I just installed postgreSQL (9.1) During the installation I am asked to provide a superuser password. I provide a ...
3
votes
2answers
4k 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 ...
4
votes
3answers
2k views

Streaming Replication in PostgreSQL

I'm trying to set up two PostgreSQL servers on one machine and perform a streaming replication. I have succeeded once, but when i've tried again following exactly the same steps it doesn't work.. ...
3
votes
2answers
1k views

Do all users need access to the postgres database in pg_hba.conf?

I was just testing the user creation process in pgAdmin. I have a database db1 for which I want to create a user to be able to connect to it. I want this to be the only database the user can connect ...
4
votes
2answers
1k views

Importing LARGE quantity of data into a PostgreSQL database

I am importing a large amount of data into a PostgreSQL server (across multiple databases on the server). When I last attempted to import the data, it effectively "crashed" my machine (Ubuntu ...
10
votes
1answer
537 views

Disable explicit commits in JDBC, detect them in SQL, or put the database in a readonly state

Background: I'm working on http://sqlfiddle.com (my site), and am trying to prevent one avenue of abuse possible there. I'm hoping that by asking about a problem I'm currently addressing, I don't ...
1
vote
1answer
349 views

Slony initial subscription is causing out-of-memory kernel panics. Why?

Context: We run Slony 2.0 with Postgres 8.4 on two CentOS 6 servers--one master, and one slave. Our database is about 30GB in size, which isn't unusual, but we do have a couple of tables that are ...
8
votes
3answers
512 views

What is retrieved from disk during a query?

Fairly simple question, probably answered somewhere, but I can't seem to form the right search question for Google... Do the number of columns in a particular table affect the performance of a query, ...
2
votes
1answer
18k views

How to import a.csv file into a postgresql database using \copy?

I am trying to import a .csv file into a postgresql database. I am using pgadmin III for that on a win7 machine. My query looks like that: \COPY pop_grid(GRID_ID, POP_TOT, YEAR, METHD_CL, CNTR_CODE, ...
2
votes
2answers
316 views

speeding up a deletion in postgresql

I came up with: drop table if exists idtemp; create temp table idtemp as select documentid from taskflag where taskid='coref' and state = 2 order by statechanged asc limit howmany; ...
2
votes
3answers
685 views

Postgresql sync databases

I am having a postgres database on my portable and on a server. I would like to keep those two in sync as easy as possible. I know about slony but I am not able to figure out: Does it work when the ...
15
votes
1answer
30k views

How to connect to an remote PostgreSQL database on Ubuntu using pgAdmin3?

I´m trying to setup an PostgreSQL database on an Ubuntu machine. I would like to be able to access it using pgAdmin3 from a remote machine. How do I setup this? I have installed the PostgreSQL ...
16
votes
3answers
10k views

Are regular VACUUM ANALYZE still recommended under 9.1?

I'm using PostgreSQL 9.1 on Ubuntu. Are scheduled VACUUM ANALYZE still recommended, or is autovacuum enough to take care of all needs? If the answer is "it depends", then: I have a largish database ...
3
votes
2answers
289 views

Migrating and normalizing data

We are rewriting a large Django application which uses a MySQL database, and the database schema needs to undergo major modifications. We're also porting the app to use PostgreSQL, for a couple of ...
0
votes
2answers
667 views

Creating a test database from Production database (different machines & servers)

I'd like to set up a test database on a separate server. Production database is MS SQL Server and the test server is a *nix box so I'd like to have the test server running either PostgreSQL or MySQL. ...
3
votes
1answer
4k views

how do I execute a void-returning procedure in pgsql 9.1?

If I execute the following in a file with the pgsql command, it complains that the procedure needs to be called with 'perform'. But when I try to use perform, it tells me that perform is not defined. ...
1
vote
1answer
191 views

using COPY command and wal_buffers

since COPY command runs inside a single transaction, if its WAL data doesn't fit into wal_buffers? for example if we are bulk importing from CSV file.
3
votes
1answer
2k views

Difference between fsync and synchronous_commit - postgresql

What is the difference between fsync and synchronous_commit? I read the documentation, the only thing I understood is both of them are trying to make updates physically written to disk.
3
votes
1answer
600 views

What happens when checkpoint_segments reached?

I'm a bit confused with checkpoint_segments definition in PostgreSQL documentation. What happens when checkpoint_segments reached? The dirty pages in shared_buffers written to WAL. Then what is the ...
9
votes
4answers
14k views

tuning postgresql for large amounts of ram

I have two identical servers (in terms of hardware), they are both standard installations of windows server 2008 r2, with minimal software installed (basically my code and required stuff like jvm ...
7
votes
2answers
4k views

Can I have one table be an “alias”, or “symlink”, to another?

I have two tables with the same structure, A and B. A certain application is written so that it always writes the same data to both tables. After a discussion with a colleague about the potential to ...
2
votes
0answers
36 views

Splitting a wide table [duplicate]

Possible Duplicate: Database Design: New Table versus New Columns I'm in the process of building a DB schema that contains information about something we call "blocks" (not very important ...
12
votes
3answers
1k views

Can spatial index help a “range - order by - limit” query

Asking this question, specifically for Postgres, as it has good supoort for R-tree/spatial indexes. We have the following table with a tree structure (Nested Set model) of words and their ...
3
votes
1answer
342 views

PostgreSQL memory spike upgrade from 8.2 to 9.1

We recently upgraded a few of our development computers from PostgreSQL 8.2 to 9.1, with plans on eventually upgrading our production servers. Everything seems well with the restore of the databases, ...
5
votes
1answer
564 views

Upgrade Postgres without doing a pg_dumpall

I'm upgrading from postgres 8.4 to 9.0 and looking at the manual it looks like this is my only choice: pg_dumpall -p 5432 | psql -d postgres -p 6543 Which means I'll need to stop any writes to the ...
2
votes
1answer
198 views

How do I resolve Postgresql error, “PL/Perl function must return reference to hash or array”?

The follow code used to work in Postgresql 8.4.11 with perl v5.10.1: =# select * From testfunction(); testfunction ------------------------ http://www.google.com/ However, after doing ...
3
votes
1answer
2k views

Pgpool, Postgresql and Apache tuning (1000 concurrent spatial queries) [closed]

I'm trying to configure a load balancing system. I've a python script, invoked through mod_wsgi on Apache, that generates a query and executes it on pgpool: request-> wsgi python -> pgpool -> ...
5
votes
1answer
816 views

Difference between idx_tup_read and idx_tup_fetch on Postgres

On Postgres 8.4 when you do: select * from pg_stat_all_indexes where relname = 'table_name'; It returns the fields idx_tup_read and idx_tup_fetch, what is the difference?
0
votes
2answers
2k views

How to convert SQL Server .MDF database to Mac OS PostgreSQL database on Mac OS X?

I need to import a SQL Server database which is in the .mdf format into a PostgreSQL database. My system is Mac OS X. How to do it in the easiest way?
11
votes
3answers
9k views

Created user can access all databases in PostgreSQL without any grants

I must be missing something with regards to setting up PostgreSQL. What I'd like to do is create multiple databases and users that are isolated from each other so that a specific user only has access ...
1
vote
1answer
342 views

Partial vacuum and whole table vacuum

From postgresql document, I know vacuum can skip pages that are already marked in visibility map, so vacuum progress only vacuum pages which requires vacuum,and we call this partival vacuum; ...
1
vote
1answer
636 views

Behavior of PostgreSQL COPY FROM

Let me preface this question by stating that my experience with DBA is limited to an introductory undergraduate university course, and that I'm just getting started with PostgreSQL. I would like to ...
5
votes
1answer
512 views

Is there a repository for pgadmin plugins? [closed]

I've been using PostgreSQL with PGAdmin III for a while now and it's been bugging me that there is a plugins menu option that is empty. I've Googled some and found a plugin here and there but I wanted ...
12
votes
1answer
15k views

How to get a working and complete PostgreSQL DB backup and test

I was hoping I could get a clear answer on how to ensure taking a full Postgres backup just like you would get with MS SQL Server, and then take care of orphaned users. From what I've read, and it ...
5
votes
5answers
2k views

Altering table schema takes too much time

I am using PostgreSQL database. I have a table with millions of rows. I have a varchar column with 2000 size and i want to make it to 4000. I ran the alter table command, but it is taking too much ...
13
votes
1answer
581 views

Why is there a PostgreSQL Turtle?

I was just checking out the propaganda page for PostgreSQL and I found this little piece of art: It is the "Turtle Style" PostgreSQL logo. How old is this, and did PostgreSQL ever officially use a ...
1
vote
4answers
576 views

Performance degradation while updating tables having 10s of millions of records

I want to update tables ( my be 20-30 ) having 10s of millions of records each. The problem is that it is taking too much time for the update process and also at that time CPU usage also goes very ...
4
votes
1answer
370 views

How do I resolve Postgresql error, 'no collation was derived for column “foo” with collatable type citext'?

Just recently I upgraded from Postgresql 8.4.11 to 9.1.3. I used pg_dump in the process. Now I'm getting an error: ERROR: no collation was derived for column "vin" with collatable type citext ...
2
votes
1answer
409 views

How do I resolve Postgresql error, “could not determine which collation to use for string comparison”?

When ever I run this SQL script I get: ERROR: could not determine which collation to use for string comparison This is what is on line 34: CREATE TEMPORARY TABLE weight_options AS SELECT ...