0% found this document useful (0 votes)
32 views3 pages

1

The document details the creation of a PostgreSQL table called connection_info to store network connection information, including fields for endpoint IDs and types. It also creates indexes on various fields and defines triggers for deleting related data and logging changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views3 pages

1

The document details the creation of a PostgreSQL table called connection_info to store network connection information, including fields for endpoint IDs and types. It also creates indexes on various fields and defines triggers for deleting related data and logging changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

-- Table: public.

connection_info

-- DROP TABLE public.connection_info;

CREATE TABLE public.connection_info


(
a_end_system_id character varying(255) COLLATE pg_catalog."default",
a_end_type character varying(255) COLLATE pg_catalog."default",
a_end_name character varying(255) COLLATE pg_catalog."default",
a_end_id character varying(255) COLLATE pg_catalog."default",
a_end_port_core_no integer,
a_end_port_no character varying(255) COLLATE pg_catalog."default",
b_end_system_id character varying(255) COLLATE pg_catalog."default",
b_end_type character varying(255) COLLATE pg_catalog."default",
b_end_name character varying(255) COLLATE pg_catalog."default",
b_end_id character varying(255) COLLATE pg_catalog."default",
b_end_port_core_no integer,
b_end_port_no character varying(255) COLLATE pg_catalog."default",
conn_element_system_id character varying(255) COLLATE pg_catalog."default",
conn_element_id character varying(255) COLLATE pg_catalog."default",
conn_element_ports character varying(255) COLLATE pg_catalog."default",
conn_element_parent_id character varying(255) COLLATE pg_catalog."default",
conn_status character varying(255) COLLATE pg_catalog."default",
conn_date timestamp without time zone DEFAULT ('now'::text)::timestamp without
time zone,
customer_name character varying(2000) COLLATE pg_catalog."default",
physical_circuit_id character varying(255) COLLATE pg_catalog."default",
user_name character varying(255) COLLATE pg_catalog."default",
connection_id integer NOT NULL DEFAULT nextval('connection_id_seq'::regclass),
user_id integer DEFAULT 0,
approver_id integer DEFAULT 0,
request_no character varying(255) COLLATE pg_catalog."default",
isapproved boolean DEFAULT true,
a_cable_side character(1) COLLATE pg_catalog."default",
b_cable_side character(1) COLLATE pg_catalog."default",
CONSTRAINT connection_id_pk PRIMARY KEY (connection_id),
CONSTRAINT connection_info_ukey UNIQUE (a_end_id, a_end_port_core_no, b_end_id,
b_end_port_core_no, conn_element_system_id)
)
WITH (
OIDS = TRUE
)
TABLESPACE pg_default;

ALTER TABLE public.connection_info


OWNER to postgres;

-- Index: connection_info_a_end_id_a_end_port_core_no_idx

-- DROP INDEX public.connection_info_a_end_id_a_end_port_core_no_idx;

CREATE INDEX connection_info_a_end_id_a_end_port_core_no_idx


ON public.connection_info USING btree
(a_end_id COLLATE pg_catalog."default", a_end_port_core_no)
TABLESPACE pg_default;

-- Index: connection_info_a_end_id_idx

-- DROP INDEX public.connection_info_a_end_id_idx;


CREATE INDEX connection_info_a_end_id_idx
ON public.connection_info USING btree
(a_end_id COLLATE pg_catalog."default")
TABLESPACE pg_default;

-- Index: connection_info_a_end_type_idx

-- DROP INDEX public.connection_info_a_end_type_idx;

CREATE INDEX connection_info_a_end_type_idx


ON public.connection_info USING btree
(a_end_type COLLATE pg_catalog."default")
TABLESPACE pg_default;

-- Index: connection_info_b_end_id_b_end_port_core_no_idx

-- DROP INDEX public.connection_info_b_end_id_b_end_port_core_no_idx;

CREATE INDEX connection_info_b_end_id_b_end_port_core_no_idx


ON public.connection_info USING btree
(b_end_id COLLATE pg_catalog."default", b_end_port_core_no)
TABLESPACE pg_default;

-- Index: connection_info_b_end_id_idx

-- DROP INDEX public.connection_info_b_end_id_idx;

CREATE INDEX connection_info_b_end_id_idx


ON public.connection_info USING btree
(b_end_id COLLATE pg_catalog."default")
TABLESPACE pg_default;

-- Index: connection_info_b_end_type_idx

-- DROP INDEX public.connection_info_b_end_type_idx;

CREATE INDEX connection_info_b_end_type_idx


ON public.connection_info USING btree
(b_end_type COLLATE pg_catalog."default")
TABLESPACE pg_default;

-- Index: connection_info_request_no_idx

-- DROP INDEX public.connection_info_request_no_idx;

CREATE INDEX connection_info_request_no_idx


ON public.connection_info USING btree
(request_no COLLATE pg_catalog."default")
TABLESPACE pg_default WHERE isapproved = false
;

-- Trigger: trg_linkservice_deletion

-- DROP TRIGGER trg_linkservice_deletion ON public.connection_info;

CREATE TRIGGER trg_linkservice_deletion


BEFORE DELETE
ON public.connection_info
FOR EACH ROW
EXECUTE PROCEDURE public.fn_trg_delete_linkservice();

-- Trigger: trg_splicinglogdetails

-- DROP TRIGGER trg_splicinglogdetails ON public.connection_info;

CREATE TRIGGER trg_splicinglogdetails


AFTER INSERT OR DELETE
ON public.connection_info
FOR EACH ROW
EXECUTE PROCEDURE public.fn_trg_insupddel_logentry4splicing();

You might also like