AWS极光postgres是否支持过滤索引

时间:2018-06-18 15:46:36

标签: postgresql amazon-web-services aurora

我需要知道Aurora PostgreSQL是否正确实现了过滤索引。换句话说,这个陈述应该失败

INSERT INTO test("id", "name", "description", "active") VALUES ('AB41081C-2B7A-83B7-5129-C7D1718515A0', 'fred', 'flintstone', true)

这应该有效

INSERT INTO test("id", "name", "description", "active") VALUES ('DCB2C68D-54E9-C602-579B-D23B24DA8B8A', 'fred', 'flintstone', false)

给出这个结构

    --
    -- Name: test; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
    --

        CREATE TABLE test (
    id uuid NOT NULL,
    name name NOT NULL,
    description character varying(250) NOT NULL,
    active boolean NOT NULL
);


ALTER TABLE public.test OWNER TO postgres;

--
    -- Data for Name: test; Type: TABLE DATA; Schema: public; Owner: postgres
--

    COPY test (id, name, description, active) FROM stdin;
1749bc36-7af4-a0ba-2ba9-52b8b12c0c04    fred    flintstone  t
\.


--
    -- Name: test_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
    --

        ALTER TABLE ONLY test
ADD CONSTRAINT test_id_key UNIQUE (id);


--
    -- Name: ix; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
    --

        CREATE UNIQUE INDEX ix ON test USING btree (name) WHERE (active = true);

0 个答案:

没有答案