Здравствуйте. Выполняю скрипт и не пойму, почему выводит эту ошибку:
DROP TABLE budget; CREATE TABLE budget ( entry_id bigint NOT NULL, financial_year character varying(4) NOT NULL, .... oktmo_code character varying(255), orfk_entry_id bigint, parent_id bigint, CONSTRAINT budget_pkey PRIMARY KEY (entry_id) ); CREATE TABLE budget_to_budget_account ( budget_entry_id bigint NOT NULL, budget_account_entry_id bigint NOT NULL, budget_account_type character varying(255), CONSTRAINT budget_to_budget_account_pk PRIMARY KEY (budget_entry_id, budget_account_entry_id), CONSTRAINT uk_ij96hqd7kx45xsad3jsvi1m5l UNIQUE (budget_account_entry_id), CONSTRAINT bgt_bgt_acct_fk1 FOREIGN KEY (budget_entry_id) REFERENCES budget(entry_id) DEFERRABLE );
Здравствуйте. Выполняю скрипт и не пойму, почему выводит эту ошибку:
drop table budget;
CREATE TABLE budget (
entry_id bigint NOT NULL,
financial_year character varying(4) NOT NULL,
....
oktmo_code character varying(255),
orfk_entry_id bigint,
parent_id bigint,
CONSTRAINT budget_pkey PRIMARY KEY (entry_id)
);
CREATE TABLE budget_to_budget_account (
budget_entry_id bigint NOT NULL,
budget_account_entry_id bigint NOT NULL,
budget_account_type character varying(255),
CONSTRAINT budget_to_budget_account_pk PRIMARY KEY (budget_entry_id, budget_account_entry_id),
CONSTRAINT uk_ij96hqd7kx45xsad3jsvi1m5l UNIQUE (budget_account_entry_id),
CONSTRAINT bgt_bgt_acct_fk1 FOREIGN KEY (budget_entry_id) REFERENCES budget(entry_id) DEFERRABLE
);
И для последней таблицы пишет: ОШИБКА: отношение "budget" не существует
DROP TABLE IF EXISTS budget;
DROP TABLE IF EXISTS budget;