Re: Poor performance on very simple query ? - Mailing list pgsql-performance

From Markus Schaber
Subject Re: Poor performance on very simple query ?
Date
Msg-id 4523EB18.4040408@logix-tt.com
Whole thread Raw
In response to Re: Poor performance on very simple query ?  (Tobias Brox <tobias@nordicbet.com>)
List 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

pgsql-performance by date:

Previous
From: Geoffrey
Date:
Subject: Re: Unsubscribe
Next
From: Steve Peterson
Date:
Subject: UPDATE becomes mired / win32