In PostgreSQL the equivalent table might be:
CREATE TABLE serial_exmpl ( id SERIAL PRIMARY KEY, abc TEXT )
Replace the NULL with DEFAULT and PostgreSQL will insert the next sequence value for you:
INSERT INTO serial_exmpl VALUES(DEFAULT, 'Remember: NULL is the absence of a value')
If for whatever reason it is not possible to convert the MySQL statements to use DEFAULT, it is possible to define a trigger on the affected table(s) like this:
CREATE OR REPLACE FUNCTION null_to_default() RETURNS TRIGGER AS ' BEGIN IF NEW.id IS NULL THEN SELECT INTO NEW.id nextval(''public.serial_exmpl_id_seq''::text); END IF; RETURN NEW; END; ' LANGUAGE 'plpgsql'; CREATE TRIGGER serial_exmpl_trg BEFORE INSERT ON serial_exmpl FOR EACH ROW EXECUTE PROCEDURE null_to_default();
This ensures that insertion of a NULL value will result in automatic conversion to the next sequence value.
so i am going to ttry it and guess were it goes if it goes and i will be back to answer my own post again i guess... you folks are letting me down here... cant any one find the rime to give me a bit of encouragement or even a hint
]]>
]]>
Could not execute command: CREATE TABLE pgsql.so config ( field VARCHAR(255) NOT NULL, value TEXT, CONSTRAINT pgsql.so conf_fie_pk PRIMARY KEY (field) )
setup
Component or plugin
From version
To version
Ok i am using posthres 8.1 and mahara 1.2 and thi is what i get at www.babblefishsn.cm/mahara
Information