Home > Archive > PostgreSQL Discussion > February 2006 > non-btree primary key









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author non-btree primary key
Roman Neuhauser

2006-02-28, 8:28 pm

Hello,

looks like PostgreSQL (8.0/8.1) has no support for using
other-than-btree indexes for primary keys. Is there a (perhaps
un(der)documented) way to specify the index type?

Rationale: I'm trying to have PKs on a type that defines only the = and
<> operators, and would work with a hash-based PK. I know I could work
around it with a UNIQUE INDEX, but would like to avoid that for exactly
the reason described in the manual:

: Technically, PRIMARY KEY is merely a combination of UNIQUE and NOT
: NULL, but identifying a set of columns as primary key also provides
: metadata about the design of the schema, as a primary key implies
: that other tables may rely on this set of columns as a unique
: identifier for rows.

Please cc me on replies, I have problems with the postgresql.org
majordomo.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Tom Lane

2006-02-28, 8:28 pm

Roman Neuhauser <neuhauser@sigpipe.cz> writes:
> looks like PostgreSQL (8.0/8.1) has no support for using
> other-than-btree indexes for primary keys. Is there a (perhaps
> un(der)documented) way to specify the index type?


No --- at present this is not possible because btree is the only index
type that implements uniqueness checking. If that got fixed, we might
consider adding syntax to allow PK specification of index type.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com