If you want ORDER BY on the column to default to your custom ordering,
the only way is a distinct datatype that you can make your custom
opclass be the default for.
The domain idea might work, I'm not totally sure. Defining
functions/operators on a domain is a bit ticklish because anything but
Heikki Linnakangas wrote:
Michael Enke wrote:
My primary goal is to get quasi numeric ordering on text column, e.g.
1
2
10
Normal order with varchar would be
1
10
2
You don't need to custom type for that. A custom operator class with
custom comparison operators is enough.
Ok, I tried
Michael Enke [EMAIL PROTECTED] writes:
Heikki Linnakangas wrote:
You don't need to custom type for that. A custom operator class with
custom comparison operators is enough.
Ok, I tried with ordinary varchar and my own operators/op class. But than:
1) the index is never used (I created it
Hello everyone,
I have created a new data type mychar. How can I specify a limit for it?
This (unlimited version) works fine:
create table table_a(col_a mychar);
This gives an error:
create table table_a(col_a mychar(10));
ERROR: syntax error at or near ( bei Zeichen 34
ZEILE 1: create table
On Wed, Jun 27, 2007 at 02:08:43PM +0200, Michael Enke wrote:
Hello everyone,
I have created a new data type mychar. How can I specify a limit for it?
This (unlimited version) works fine:
create table table_a(col_a mychar);
What you want is called user defined typmod and I don't beleive any
Martijn van Oosterhout wrote:
On Wed, Jun 27, 2007 at 02:08:43PM +0200, Michael Enke wrote:
Hello everyone,
I have created a new data type mychar. How can I specify a limit for it?
This (unlimited version) works fine:
create table table_a(col_a mychar);
What you want is called user defined
Joshua D. Drake wrote:
Martijn van Oosterhout wrote:
On Wed, Jun 27, 2007 at 02:08:43PM +0200, Michael Enke wrote:
Hello everyone,
I have created a new data type mychar. How can I specify a limit
for it?
This (unlimited version) works fine:
create table table_a(col_a mychar);
What
Michael Enke wrote:
My primary goal is to get quasi numeric ordering on text column, e.g.
1
2
10
Normal order with varchar would be
1
10
2
You don't need to custom type for that. A custom operator class with
custom comparison operators is enough.
--
Heikki Linnakangas
EnterpriseDB