Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ngqhS-0008FZ-Dn for pgsql-sql@arkaria.postgresql.org; Tue, 19 Apr 2022 16:27:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ngqhQ-00080Z-5G for pgsql-sql@arkaria.postgresql.org; Tue, 19 Apr 2022 16:27:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ngqhP-00080Q-RF for pgsql-sql@lists.postgresql.org; Tue, 19 Apr 2022 16:27:31 +0000 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ngqhN-0008CJ-SG for pgsql-sql@lists.postgresql.org; Tue, 19 Apr 2022 16:27:31 +0000 Received: by mail-lj1-x235.google.com with SMTP id w5so7987503lji.4 for ; Tue, 19 Apr 2022 09:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=3GX+TLoTDjMk2kLlnbsc04gc2qHNGI8H8K+mlv7rUwo=; b=IlJYuCUwaS+oTrVVKJ05SuBWB8yG6H80pNxRmM2piDYdL01GBgCi7j0itWh/cMG2YP hm0GxFZ5ONlv7IcQn2mXANgrci0myUBjMAAxqdQAaznADyVu2SxN/talYs1y7nLBTm6d LyawaUOYRVs+iETkC2i9onTc+9xX2E3Uzb+3m6qIX9IzuXP5iZsmv8MKEcKWzMp9Fa8X 3ydizcNWhoWwjuBJUV/8TGRafuORmjmJg00sQCysvuPm9WpUEr7ggTCgnhle2OUtJ1ts L4xvbU4pCvsXQ/EEuT1aVDK9GetOH3gxFW2yhxZF0OQ4iehOFs4hgXpFKcrQxHKhs6M4 hzSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3GX+TLoTDjMk2kLlnbsc04gc2qHNGI8H8K+mlv7rUwo=; b=ak2PdthAk4xv8VA+idqDidQHpyBY14oefZpiwgvSXgSqw18bIH6Sp3P5ZmkwWZ3q+4 soPVTpITmocnHhm6y2fY3rkorfkoe6sOOSBwjzTZ+M5Q2W3qtdVCoUo43GfIEFk097Mx 5QhGbjGETrCFKC1vNvt087UAE+BQ6Yob+6KEpye5wqkDmSJkRdVwbXtlImrf6Xj+ske3 gsTn306XgCxGkd03NkSPilylkQGV+ReWC5pm17xfC7hpGBpup4BSYv2lKr3x9tc0KS+w uaaQ1A9nDPnf4eHd1wioBl+kytqd+fudmObkVGcp/J0hGhxnQtFhhE2E+HcfmhntAm4P uY+A== X-Gm-Message-State: AOAM533aGG2rNyBMGdObkUWdSewzjZkxPWOd4iD/vxbIxiPht12+o0pH 8f0Lk4xWtPmS1HXaH157Ihd6oZFJdXOzAzcr+QDsG1VBdb4= X-Google-Smtp-Source: ABdhPJzEWij3E6eKdVpRUxEDailbHbZe1HRGlR2fwLWaEZX8Tbydl1nt87nPSdR88w22sgIRV2jRZm4F/MFpsZaPqbg= X-Received: by 2002:a2e:a88b:0:b0:24b:5714:213d with SMTP id m11-20020a2ea88b000000b0024b5714213dmr10514820ljq.412.1650385649056; Tue, 19 Apr 2022 09:27:29 -0700 (PDT) MIME-Version: 1.0 From: aditya desai Date: Tue, 19 Apr 2022 21:57:18 +0530 Message-ID: Subject: Create index on user defined type To: pgsql-sql Content-Type: multipart/alternative; boundary="0000000000005ac06105dd045a00" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005ac06105dd045a00 Content-Type: text/plain; charset="UTF-8" Hi, Is there any way to create index on user defined type in Postgresql? Need to create index on bug_status in bug table. CREATE TYPE bug_status AS ENUM ('new', 'open', 'closed'); CREATE TABLE bug ( id serial, description text, status bug_status ); Regards, Aditya. --0000000000005ac06105dd045a00 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
Is there any way to create index = on user defined type in Postgresql? Need to create index on bug_status in b= ug table.

CREATE TYPE bug_status AS ENUM (= 9;new', 'open', 'closed');

CRE= ATE TABLE bug (
=C2=A0 =C2=A0 id serial,
=C2=A0 =C2=A0 = description text,
=C2=A0 =C2=A0 status bug_status
);

Regards,
Aditya.
--0000000000005ac06105dd045a00--