pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
how to index a numeric(12,2) column?
4+ messages / 2 participants
[nested] [flat]

* how to index a numeric(12,2) column?
@ 2000-11-07 22:57 Forest Wilkinson <fspam@home.com>
  2000-11-07 23:48 ` Re: how to index a numeric(12,2) column? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Forest Wilkinson @ 2000-11-07 22:57 UTC (permalink / raw)
  To: pgsql-sql

I'd like to create an index on a column whose type is NUMERIC(12,2).
There appears to be no default operator class for the numeric type.  What
class should I use instead?  My guess is that something like this might
work:

CREATE INDEX foo_idx on foo (bar int8_ops);

Will that work properly?  Will it do me any good?  Is there a better way?





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: how to index a numeric(12,2) column?
  2000-11-07 22:57 how to index a numeric(12,2) column? Forest Wilkinson <fspam@home.com>
@ 2000-11-07 23:48 ` Tom Lane <tgl@sss.pgh.pa.us>
  2000-11-08 18:49   ` Re: how to index a numeric(12,2) column? Forest Wilkinson <fspam@home.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2000-11-07 23:48 UTC (permalink / raw)
  To: Forest Wilkinson <fspam@home.com>; +Cc: pgsql-sql

Forest Wilkinson <fspam@home.com> writes:
> I'd like to create an index on a column whose type is NUMERIC(12,2).
> There appears to be no default operator class for the numeric type.

Uh, what version are you using?  Works fine for me in 7.0.2.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: how to index a numeric(12,2) column?
  2000-11-07 22:57 how to index a numeric(12,2) column? Forest Wilkinson <fspam@home.com>
  2000-11-07 23:48 ` Re: how to index a numeric(12,2) column? Tom Lane <tgl@sss.pgh.pa.us>
@ 2000-11-08 18:49   ` Forest Wilkinson <fspam@home.com>
  2000-11-08 19:06     ` Re: how to index a numeric(12,2) column? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Forest Wilkinson @ 2000-11-08 18:49 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql

>> I'd like to create an index on a column whose type is NUMERIC(12,2).
>> There appears to be no default operator class for the numeric type.
>
>Uh, what version are you using?  Works fine for me in 7.0.2.

Sorry; I hit send before adding that information.  I'm using postgres
6.5.3 on i386 Red Hat 6.1.

It allows me to create an index on a NUMERIC(12,2) field using the
int8_ops class, but I'm wondering if this might have some undesirable
hidden side effects.

CREATE TABLE foo (id INTEGER, bar NUMERIC(12,2));
CREATE INDEX foo_idx on foo (bar int8_ops);




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: how to index a numeric(12,2) column?
  2000-11-07 22:57 how to index a numeric(12,2) column? Forest Wilkinson <fspam@home.com>
  2000-11-07 23:48 ` Re: how to index a numeric(12,2) column? Tom Lane <tgl@sss.pgh.pa.us>
  2000-11-08 18:49   ` Re: how to index a numeric(12,2) column? Forest Wilkinson <fspam@home.com>
@ 2000-11-08 19:06     ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2000-11-08 19:06 UTC (permalink / raw)
  To: Forest Wilkinson <fspam@home.com>; +Cc: pgsql-sql

Forest Wilkinson <fspam@home.com> writes:
> Sorry; I hit send before adding that information.  I'm using postgres
> 6.5.3 on i386 Red Hat 6.1.

Time to update, then.

> It allows me to create an index on a NUMERIC(12,2) field using the
> int8_ops class, but I'm wondering if this might have some undesirable
> hidden side effects.

Yes, and they won't be too hidden either: it won't work :-(

Current sources check for that sort of type mismatch, but 6.5 failed to
do so.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2000-11-08 19:06 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-11-07 22:57 how to index a numeric(12,2) column? Forest Wilkinson <fspam@home.com>
2000-11-07 23:48 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-11-08 18:49   ` Forest Wilkinson <fspam@home.com>
2000-11-08 19:06     ` Tom Lane <tgl@sss.pgh.pa.us>

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