pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schaber <schabi@logix-tt.com>
To: pgsql-performance@postgresql.org
Subject: Re: Poor performance on very simple query ?
Date: Wed, 04 Oct 2006 19:10:48 +0200
Message-ID: <4523EB18.4040408@logix-tt.com> (raw)
In-Reply-To: <20061003121709.GF30211@oppetid.no>
References: <45224896.7040708@freesurf.fr>
	<20061003121004.GC30211@oppetid.no>
	<20061003121109.GD30211@oppetid.no>
	<45225407.7090805@freesurf.fr>
	<20061003121709.GF30211@oppetid.no>

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



view thread (14+ messages)

Message-ID: <4523EB18.4040408@logix-tt.com>
Permalink:  ../4523EB18.4040408@logix-tt.com/
Also on:    postgresql.org/message-id/4523EB18.4040408@logix-tt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: schabi@logix-tt.com
  Subject: Re: Poor performance on very simple query ?
  In-Reply-To: <4523EB18.4040408@logix-tt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox