473,503 Members | 10,322 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with create index



Hmmm... am i doing anything really silly?

tradein_clients=# CREATE INDEX profile_master2 on profile_master (lower( btrim(email) ) );
ERROR: parser: parse error at or near "(" at character 61
tradein_clients=#
Regds
mallah.

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

Nov 12 '05 #1
2 1704
On Tue, 11 Nov 2003, Rajesh Kumar Mallah wrote:
Hmmm... am i doing anything really silly?
Functional indexes on 7.3 and earlier only allow a function over one or
more columns (which would disallow the below as a function over a function
over a column). The usual workaround would be to make an immutable
function that does both functions on its argument something like:

create function lower_btrim(text) returns text as 'select
lower(btrim($1));' language 'sql' immutable;
create index profile_master2 on profile_master(lower_btrim(email));

In 7.4 I believe the below should work.
tradein_clients=# CREATE INDEX profile_master2 on profile_master (lower( btrim(email) ) );
ERROR: parser: parse error at or near "(" at character 61


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #2
On Tuesday 11 Nov 2003 2:00 pm, Stephan Szabo wrote:
On Tue, 11 Nov 2003, Rajesh Kumar Mallah wrote:
Hmmm... am i doing anything really silly?
Functional indexes on 7.3 and earlier only allow a function over one or
more columns (which would disallow the below as a function over a function
over a column). The usual workaround would be to make an immutable
function that does both functions on its argument something like:

create function lower_btrim(text) returns text as 'select
lower(btrim($1));' language 'sql' immutable;
create index profile_master2 on profile_master(lower_btrim(email));

Thanks for the work around


In 7.4 I believe the below should work.
tradein_clients=# CREATE INDEX profile_master2 on profile_master (lower(
btrim(email) ) ); ERROR: parser: parse error at or near "(" at character
61


Yes it does work

template1=# CREATE INDEX profile_master2 on t_a(lower(btrim(email)));
CREATE INDEX
template1=#
template1=# CREATE unique INDEX profile_master3 on t_a(lower(btrim(email)));
CREATE INDEX
template1=#
Regds
Mallah.

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

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2796
by: Guy Deprez | last post by:
Hi, i'm having a problem to create indexes. STEP 1 ----------- Connection is OK (you can find the string at the end of the message) Table ("Couleurs") creation is OK STEP 2. Index Creation
6
1674
by: Rajesh Kumar Mallah | last post by:
Hi, I face the following problem in transferring data from pgsql 7.3.4 to pgsql 7.4 RC1 . I am piping the output of pg_dumpall from 7.3 to 7.4 running on different port. The problem is there...
4
2081
by: Fan Ruo Xin | last post by:
Hi, I have been watching MDC for a long time ... I have seen it from INDEX-SCAN to INDEX ONLY for the DISTINCT (block index columns) operator .... But the Elapsed time shows MDC still run slower....
4
3042
by: Jagdip Singh | last post by:
Hi all, I am getting this problem. Script and error are below connect to jagdip user db2inst1 using ibmdb2 @ set current sqlid='db2inst1' @ drop function salesamount @ drop table...
20
2469
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
7
6914
by: Salvador | last post by:
Hi, I am using WMI to gather information about different computers (using win2K and win 2K3), checking common classes and also WMI load balance. My application runs every 1 minute and reports...
0
2993
by: Spacen Jasset | last post by:
I am running postgresql at version 8.1 on a windows xp desktop machine. I then loaded 40 million rows into a table of 6 varchar fields ( The sum total length of a row is on average about 100...
4
2058
by: Laurence Breeze | last post by:
I wonder if anyone can help ... Today I tried to create another non-clustered index on a table. This failed as I apparently already had 249 non-clustered indexex on the table. Looking at the...
15
2222
RMWChaos
by: RMWChaos | last post by:
In my ongoing effort to produce shorter, more efficient code, I have created a "chicken and egg" / "catch-22" problem. I can think of several ways to fix this, none of them elegant. I want my code...
3
1903
by: mearvk | last post by:
I am unable to get Xerces to write out attributes from a struct which I am able to print out and verify is correct. The structs are defined below as is subsection of the output. int...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.