PostgreSQL is an open-source, object-relational database management system (ORDBMS) available for many platforms including Linux, UNIX, MS Windows and Mac OS X. Please mention your PostgreSQL version when asking questions.
168
votes
7answers
76k views
PostgreSQL “DESCRIBE TABLE”
How do you perform the equivalent of Oracle's DESCRIBE TABLE in PostgreSQL (using the psql command)?
155
votes
7answers
50k views
Comparison of full text search engine - Lucene, Sphinx, Postgresql, MySQL?
I'm building a Django site and I am looking for a search engine.
A few candidates:
Lucene/Lucene with Compass/Solr
Sphinx
Postgresql built-in full text search
MySQl built-in full text search
...
154
votes
15answers
17k views
Would you recommend PostgreSQL over MySQL? [closed]
We are currently working with JavaEE and MySQL 5 in our company, but we have some queries, especially delete queries that take > 10 min to execute. We consider to switch to PostgreSQL.
What are the ...
152
votes
25answers
6k views
What resources exist for Database performance-tuning?
What good resources exist for understanding database tuning on the major engines and advancing your knowledge in that area?
The idea of this question is to collect the shed load of resources that ...
146
votes
15answers
44k views
Repairing Postgresql after upgrading to OSX 10.7 Lion
I recently upgraded to OSX 10.7, at which point my rails installation completely borked when trying to connect to the psql server. When I do it from the command line using
psql -U postgres
it ...
126
votes
7answers
45k views
Creating a copy of a database in Postgres
What's the correct way to copy entire database (its structure and data) to a new one in pgAdmin?
126
votes
12answers
58k views
Insert, on duplicate update (postgresql)
Several months ago I learnt from here how to perform multiple updates at once in MySQL using the following syntax
INSERT INTO table (id, field, field2) VALUES (1, A, X), (2, B, Y), (3, C, Z)
ON ...
121
votes
22answers
8k views
Is email address a bad primary key
Is email address a bad candidate for primary when compared to auto incrementing numbers. Our web application needs the email address to be unique in the system. So, I thought of using email address ...
97
votes
8answers
38k views
Can't find the 'libpq-fe.h header when trying to install pg gem on ubuntu
I am using rails 3.1 pre version. I like to use PostgreSQL but the problem is installing the pg gem. It gives me the following error:
demonchand@system-001:~/exercise/personal/pro$ gem install pg
...
94
votes
4answers
82k views
PostgreSQL Autoincrement
I'm switching from MySQL to PostgreSQL and was wondering how I can do autoincrement values. I saw in the PostgreSQL docs a datatype "serial", but I get syntax errors when using it (in v8.0).
88
votes
3answers
22k views
How to exit from PostgreSQL command line utility: psql
How to exit command line utility psql for PostgreSQL?
85
votes
19answers
8k views
Why isn't PostgreSQL as widespread as MySQL? [closed]
I'm currently developing a pretty big project, and I'm considering open source databases to use.
One of the main factors I consider is support, and it seems like there is not much support/community ...
84
votes
4answers
57k views
How to log Postgres SQL queries?
Can anyone tell me how to enable logging of all SQL executed by Postgres (8.3)? Thanks!
Edited (more info)
I changed these lines :
log_directory = 'pg_log'
log_filename = ...
80
votes
13answers
36k views
How to reset postgres' primary key sequence when it falls out of sync?
I ran into the problem that my primary key sequence is not in sync with my table rows.
That is, when I insert a new row I get a duplicate key error because the sequence implied in the serial ...
79
votes
3answers
57k views
Select first row in each GROUP BY group?
As the title suggests, I'd like to select the first row of each set of rows grouped with a GROUP BY.
Specifically, if I've got a "purchases" table that looks like this:
> SELECT * FROM purchases:
...