X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B35CC32ADC5 for ; Thu, 21 Oct 2004 03:25:24 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07802-02 for ; Thu, 21 Oct 2004 02:25:16 +0000 (GMT) Received: from mail.ge-ts.com.hk (unknown [202.66.115.131]) by svr1.postgresql.org (Postfix) with ESMTP id 5B05932A4B0 for ; Thu, 21 Oct 2004 03:25:17 +0100 (BST) Received: from raysiu ([172.16.96.15]) by mail.ge-ts.com.hk (8.12.8/8.12.8) with SMTP id i9L2PGCh013233 for ; Thu, 21 Oct 2004 10:25:17 +0800 Message-ID: <069201c4b715$34851670$0f6010ac@raysiu> From: "Ray" To: Subject: create index with substr function Date: Thu, 21 Oct 2004 10:25:17 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_068F_01C4B758.4260C620" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=HTML_40_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200410/333 X-Sequence-Number: 8809 This is a multi-part message in MIME format. ------=_NextPart_000_068F_01C4B758.4260C620 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi All, I have a table in my postgres: Table: doc Column | Type | Modifiers=20 ---------------+-----------------------------+----------- doc_id | bigint | not null comp_grp_id | bigint | not null doc_type | character varying(10)| not null doc_urn | character varying(20)| not null I want to create an index on doc_urn column with using substr function like= this: CREATE INDEX idx_doc_substr_doc_urn ON doc USING btree (SUBSTR(doc_urn,10)); but there is an error: ERROR: parser: parse error at or near "10" at character 68 what's wrong for this SQL? As I have found some reference on the internet, = I can't find anything wrong in this SQL. Thanks Ray= ------=_NextPart_000_068F_01C4B758.4260C620 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
Hi All,
 
I have a table in my postgres:
Table: doc
    =20 Column    =20 |           =20 Type            = ; |=20 Modifiers
    =20 ---------------+-----------------------------+-----------
 doc_id&n= bsp;         |=20 bigint           &nb= sp;         =20 | not null
 comp_grp_id |=20 bigint           &nb= sp;         =20 | not null
 doc_type      | character= =20 varying(10)| not null
 doc_urn      &= nbsp;=20 | character varying(20)| not null
I want to create an index on doc_urn colum= n with=20 using substr function like this:
CREATE INDEX idx_doc_substr_doc_urn ON doc= USING=20 btree (SUBSTR(doc_urn,10));
 
but there is an error:

ERROR:  parser: parse error at or near "10" at character 68
 
what's wrong for this SQL? As I have found some reference on the inter= net,=20 I can't find anything wrong in this SQL.
 
Thanks
Ray
------=_NextPart_000_068F_01C4B758.4260C620--