PostgreSQL - CREATE INDEX
Posted
by mocopera
on Stack Overflow
See other posts from Stack Overflow
or by mocopera
Published on 2010-04-21T18:29:28Z
Indexed on
2010/04/21
18:33 UTC
Read the original article
Hit count: 338
Hi! I'm working with PostgreSQL to create some data types written in C.
For example, I have:
typedef struct Point3D
{
char id[50];
double x;
double y;
double z;
} Point3D;
The input and output functions are working properly.
But the problem is the following: Every id of Point3D must be unique (and can be NULL), so I have decided to create an unique index on this field id, but is that possible?
I'm thinking in something like this: create unique index test_point3d_idx on test_point3d (( getID(columname) )); where getID returns the field ID of columname.
But I need to implement getID and I am really blocked.
Any advice?
© Stack Overflow or respective owner