DB IO - Update/Select/Insert checks are sane now and not reverse - UPDATE can now use RETURNING - meta table check in postgresql is supressing warning for not existing table and just returns false JS (edit) - update for the html element creation functions Basic: - SITE LANG settings added to change default lang based on vhost - log file id is now set more lienient via globals and not with a global constant DB Tables/Functions: - fix wrong general function and set uid function was missing
13 lines
297 B
PL/PgSQL
Executable File
13 lines
297 B
PL/PgSQL
Executable File
-- adds the created or updated date tags
|
|
|
|
CREATE OR REPLACE FUNCTION set_uid() RETURNS TRIGGER AS '
|
|
DECLARE
|
|
random_length INT = 12; -- that should be long enough
|
|
BEGIN
|
|
IF TG_OP = ''INSERT'' THEN
|
|
NEW.uid := random_string(random_length);
|
|
END IF;
|
|
RETURN NEW;
|
|
END;
|
|
' LANGUAGE 'plpgsql';
|