Re: Poor performance on very simple query ?

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Poor performance on very simple query ?
Date: 2006-10-04 17:10:48
Message-ID: 4523EB18.4040408@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi, Tobias,

Tobias Brox wrote:

> How can you have a default value on a primary key?

Just declare the column with both a default value and a primary key
constraint.

It makes sense when the default value is calculated instead of a
constant, by calling a function that generates the key.

In fact, the SERIAL type does nothing but defining a sequence, and then
use nextval('sequencename') as default.

HTH,
Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Steve Peterson 2006-10-04 17:54:30 UPDATE becomes mired / win32
Previous Message Geoffrey 2006-10-04 16:48:03 Re: Unsubscribe