CREATE SEQUENCE IF NOT EXISTS public.lntds_asset_notes_id_seq
INCREMENT 1
START 1
MINVALUE 1
MAXVALUE 2147483647
CACHE 1;
while running above script, the sequence is getting created and also visible in the schema table which is present on the left side of the PostgreSQL and also having the same variable with same values,but while executing the below script
CREATE TABLE IF NOT EXISTS public.lntds_asset_notes
(
id integer NOT NULL DEFAULT nextval(‘lntds_asset_notes_id_seq’::regclass),
asset_note character varying(255) COLLATE pg_catalog.”default”,
created_by character varying(255) COLLATE pg_catalog.”default”,
created_date timestamp(6) without time zone,
updated_by character varying(255) COLLATE pg_catalog.”default”,
updated_date timestamp(6) without time zone,
asset_id character varying(255) COLLATE pg_catalog.”default”,
CONSTRAINT lntds_asset_notes_pkey PRIMARY KEY (id),
CONSTRAINT fktqpg1q1xnoq6svphsjoh9gj1t FOREIGN KEY (asset_id)
REFERENCES public.lntds_assets (asset_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
TABLESPACE pg_default;
the error encountering is ERROR: relation “public.lntds_assets” does not exist
SQL state: 42P01
kindly help me out with this error.
Error free script, with proper script 1 and script 2 running.
Ankit Mahule is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.