All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sql.reserve_doc_ids.sql Maven / Gradle / Ivy

Go to download

PostgreSQL implementation of a ToroDB backend. This was the original backend implemented in ToroDB, and is also considered as the default ToroDB backend and a reference implementation.

The newest version!
CREATE OR REPLACE FUNCTION torodb.reserve_doc_ids(col_schema varchar, increment integer)
RETURNS integer AS $$
DECLARE
    seq_name varchar := '"' || col_schema || '".root_seq';
    temp integer;
BEGIN
    select setval(seq_name, nextval(seq_name) + increment - 1) INTO temp;

    return temp;
END;
$$ LANGUAGE plpgsql;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy