pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
index on aggregate function
6+ messages / 3 participants
[nested] [flat]

* index on aggregate function
@ 1999-01-30 15:20  Sascha Schumann <sas@schell.de>
  0 siblings, 1 reply; 6+ messages in thread

From: Sascha Schumann @ 1999-01-30 15:20 UTC (permalink / raw)
  To: pgsql-sql@hub.org

I somewhere read that it is possible to create an index on aggregate functions
in PostgreSQL. Which syntax do I have to use for it?

test=> CREATE TABLE test ( name VARCHAR(32) );
CREATE
test=> CREATE INDEX test_idx ON test lower(name);
ERROR:  parser: parse error at or near "lower"

gives me a parser error.

-- 
                     
          Regards,
						                                
                            Sascha Schumann | 
                                 Consultant | finger sas@schell.de
                                            | for PGP public key



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

* Re: [SQL] index on aggregate function
@ 1999-02-01 08:50  Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  parent: Sascha Schumann <sas@schell.de>
  0 siblings, 1 reply; 6+ messages in thread

From: Remigiusz Sokolowski @ 1999-02-01 08:50 UTC (permalink / raw)
  To: Sascha Schumann <sas@schell.de>; +Cc: pgsql-sql@hub.org

> I somewhere read that it is possible to create an index on aggregate functions
> in PostgreSQL. Which syntax do I have to use for it?
> 
> test=> CREATE TABLE test ( name VARCHAR(32) );
> CREATE
> test=> CREATE INDEX test_idx ON test lower(name);
> ERROR:  parser: parse error at or near "lower"
> 
> gives me a parser error.

Right syntax is
CREATE INDEX test_idx ON test (lower(name) text_ops);
I try it and index was generated without error
	Rem

-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *		
-----------------------------------------------------------------*****----------




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

* Re: [SQL] index on aggregate function
@ 1999-02-06 12:49  Sascha Schumann <sas@schell.de>
  parent: Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  0 siblings, 1 reply; 6+ messages in thread

From: Sascha Schumann @ 1999-02-06 12:49 UTC (permalink / raw)
  To: Remigiusz Sokolowski <rems@gdansk.sprint.pl>; +Cc: pgsql-sql@hub.org

On Mon, Feb 01, 1999 at 09:50:57AM +0100, Remigiusz Sokolowski wrote:
> > I somewhere read that it is possible to create an index on aggregate functions
> > in PostgreSQL. Which syntax do I have to use for it?
> > 
> > test=> CREATE TABLE test ( name VARCHAR(32) );
> > CREATE
> > test=> CREATE INDEX test_idx ON test lower(name);
> > ERROR:  parser: parse error at or near "lower"
> > 
> > gives me a parser error.
> 
> Right syntax is
> CREATE INDEX test_idx ON test (lower(name) text_ops);
> I try it and index was generated without error
> 	Rem

Well, that exact statement gives me:

ERROR: BuildFuncTupleDesc: function 'lower(varchar)' does not exist

I also tried varchar_ops and char_ops instead of text_ops, but that does not
resolve the problem. I'm using PostgreSQL 6.4.2 on Linux without problems so
far.

-- 
                     
          Regards,
						                                
                            Sascha Schumann | 
                                 Consultant | finger sas@schell.de
                                            | for PGP public key



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

* Re: [SQL] index on aggregate function
@ 1999-02-15 07:57  Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  parent: Sascha Schumann <sas@schell.de>
  0 siblings, 1 reply; 6+ messages in thread

From: Remigiusz Sokolowski @ 1999-02-15 07:57 UTC (permalink / raw)
  To: Sascha Schumann <sas@schell.de>; +Cc: pgsql-sql@hub.org

> > > I somewhere read that it is possible to create an index on aggregate functions
> > > in PostgreSQL. Which syntax do I have to use for it?
> > > 
> > > test=> CREATE TABLE test ( name VARCHAR(32) );
> > > CREATE
> > > test=> CREATE INDEX test_idx ON test lower(name);
> > > ERROR:  parser: parse error at or near "lower"
> > > 
> > > gives me a parser error.
> > 
> > Right syntax is
> > CREATE INDEX test_idx ON test (lower(name) text_ops);
> > I try it and index was generated without error
> > 	Rem
> 
> Well, that exact statement gives me:
> 
> ERROR: BuildFuncTupleDesc: function 'lower(varchar)' does not exist
> 
> I also tried varchar_ops and char_ops instead of text_ops, but that does not
> resolve the problem. I'm using PostgreSQL 6.4.2 on Linux without problems so
> far.

I have holidays and now have to read so much mails, that I can't find if
there were any other suggestions about that. AFAIK there is no lower()
function for varchar type and this is a problem - solution is to use text
type or create function lower() for varchar type.
	Rem

-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *		
-----------------------------------------------------------------*****----------




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

* Re: [SQL] index on aggregate function
@ 1999-02-15 12:07  jose' soares <sferac@bo.nettuno.it>
  parent: Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  0 siblings, 1 reply; 6+ messages in thread

From: jose' soares @ 1999-02-15 12:07 UTC (permalink / raw)
  To: Remigiusz Sokolowski <rems@gdansk.sprint.pl>; +Cc: Sascha Schumann <sas@schell.de>; pgsql-sql@hub.org



Remigiusz Sokolowski ha scritto:

> > > > I somewhere read that it is possible to create an index on aggregate functions
> > > > in PostgreSQL. Which syntax do I have to use for it?
> > > >
> > > > test=> CREATE TABLE test ( name VARCHAR(32) );
> > > > CREATE
> > > > test=> CREATE INDEX test_idx ON test lower(name);
> > > > ERROR:  parser: parse error at or near "lower"
> > > >
> > > > gives me a parser error.
> > >
> > > Right syntax is
> > > CREATE INDEX test_idx ON test (lower(name) text_ops);
> > > I try it and index was generated without error
> > >     Rem
> >
> > Well, that exact statement gives me:
> >
> > ERROR: BuildFuncTupleDesc: function 'lower(varchar)' does not exist
> >
> > I also tried varchar_ops and char_ops instead of text_ops, but that does not
> > resolve the problem. I'm using PostgreSQL 6.4.2 on Linux without problems so
> > far.
>
> I have holidays and now have to read so much mails, that I can't find if
> there were any other suggestions about that. AFAIK there is no lower()
> function for varchar type and this is a problem - solution is to use text
> type or create function lower() for varchar type.
>         Rem
>
> -------------------------------------------------------------------*------------
> Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *
> -----------------------------------------------------------------*****----------

--lower() works with varchar...

prova=> CREATE TABLE test ( name VARCHAR(32) );
CREATE
prova=> insert into test values ('AAAA');
INSERT 188475 1
prova=> select lower(name) from test;
lower
-----
aaaa
(1 row)

but it doesn't work on create index...

prova=> drop table test;
DROP
prova=> CREATE TABLE test ( name VARCHAR(32) );
CREATE
prova=> CREATE INDEX test_idx ON test lower(nome);
ERROR:  parser: parse error at or near "lower"

--
                               - Jose' -

And behold, I tell you these things that ye may learn wisdom; that ye may
learn that when ye are in the service of your fellow beings ye are only
in the service of your God.                - Mosiah 2:17 -





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

* Re: [SQL] index on aggregate function
@ 1999-02-15 13:50  Remigiusz Sokolowski <rems@gdansk.sprint.pl>
  parent: jose' soares <sferac@bo.nettuno.it>
  0 siblings, 0 replies; 6+ messages in thread

From: Remigiusz Sokolowski @ 1999-02-15 13:50 UTC (permalink / raw)
  To: jose' soares <sferac@bo.nettuno.it>; +Cc: Sascha Schumann <sas@schell.de>; pgsql-sql@hub.org

> --lower() works with varchar...
> 
> prova=> CREATE TABLE test ( name VARCHAR(32) );
> CREATE
> prova=> insert into test values ('AAAA');
> INSERT 188475 1
> prova=> select lower(name) from test;
> lower
> -----
> aaaa
> (1 row)
> 
> but it doesn't work on create index...
> 
> prova=> drop table test;
> DROP
> prova=> CREATE TABLE test ( name VARCHAR(32) );
> CREATE
> prova=> CREATE INDEX test_idx ON test lower(nome);
> ERROR:  parser: parse error at or near "lower"

Yes, You're right - I check it now - strange thing - and I have nothing
more to say
	Rem

-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *		
-----------------------------------------------------------------*****----------




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


end of thread, other threads:[~1999-02-15 13:50 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-01-30 15:20 index on aggregate function Sascha Schumann <sas@schell.de>
1999-02-01 08:50 ` Remigiusz Sokolowski <rems@gdansk.sprint.pl>
1999-02-06 12:49   ` Sascha Schumann <sas@schell.de>
1999-02-15 07:57     ` Remigiusz Sokolowski <rems@gdansk.sprint.pl>
1999-02-15 12:07       ` jose' soares <sferac@bo.nettuno.it>
1999-02-15 13:50         ` Remigiusz Sokolowski <rems@gdansk.sprint.pl>

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