====== Ručno izvršavanje PostgreSQL skripta za izradu "blfpub" baze ======
Potrebno je na postgres bazi, sa su pravima, prvo kreirati bazu podataka sledećom komandom:
CREATE DATABASE blfpub WITH TEMPLATE = template0 ENCODING = 'UTF8';
Zatim pokrenuti **Query tool** i sledeći skript u njemu:
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
CREATE TABLE firme (
firid integer NOT NULL,
fpok boolean DEFAULT true,
regbr character varying(50),
sifdel character varying(50),
matbr character varying(50),
ziro text DEFAULT ''::text,
slogan character varying(255),
naziv character varying(255),
adr character varying(255),
tel character varying(255),
fax character varying(255),
email character varying(255),
datapath text DEFAULT ''::text,
zirobank text DEFAULT ''::text,
ver integer DEFAULT 0,
formatdatuma character varying(50),
database character varying(50),
sifra character varying(64),
sifrahash text DEFAULT ''::text
);
ALTER TABLE ONLY firme ADD CONSTRAINT firme_pkey PRIMARY KEY (firid);
CREATE TABLE tasks
(
taskid serial NOT NULL,
taskguid character varying(255),
requesttime TIMESTAMP WITHOUT TIME ZONE,
scheduledtime TIMESTAMP WITHOUT TIME ZONE,
runstarttime TIMESTAMP WITHOUT TIME ZONE,
runendtime TIMESTAMP WITHOUT TIME ZONE,
destdb character varying(255),
cmd character varying(255),
param1 character varying(255),
param2 character varying(255),
param3 character varying(255),
param4 character varying(255),
param5 character varying(255),
result integer,
resultmsg text,
computername character varying(255),
username character varying(255),
korid integer,
CONSTRAINT tasks_pkey PRIMARY KEY (taskid)
);
GRANT ALL ON DATABASE blfpub TO public;
GRANT ALL ON DATABASE blfpub TO postgres;
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;