select
table_name,
table_schema as cnt
from information_schema.columns
where
table_schema = 'public'
group by
table_schema,
table_name 20 sty 2010
select
table_name,
table_schema as cnt
from information_schema.columns
where
table_schema = 'public'
group by
table_schema,
table_name Definicja triggera
CREATE TRIGGER set_mapa_tgr
BEFORE INSERT
ON m_trips_s
FOR EACH ROW
EXECUTE PROCEDURE set_mapa_ft();Definicja funkcji triggera
CREATE OR REPLACE FUNCTION set_mapa_ft()
RETURNS trigger AS
$BODY$
BEGIN
IF NEW.h_opcja = 'Chełm' THEN
NEW.opcja2 = 'Chełm'; --NEW.opcja3;
RAISE NOTICE 'Wartosc2: %', NEW.opcja2 ;
ELSIF NEW.h_opcja = 'Warszawa' THEN
NEW.t_depPlace = 'Warszawa';
END IF;
RAISE NOTICE 'Wartosc: %', NEW.t_depPlace;
RETURN NEW;
END
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
ALTER FUNCTION set_mapa_ft() OWNER TO mapa; wartosc integer := 80;
RAISE NOTICE 'Wartosc %', wartosc;
RAISE NOTICE 'Koniec'; pg_dump -h host -d baza_www -U user -t tabela -f 'plik.txt' -a -W
psql -h host -d baza_www -U user -f 'plik.txt' -W