Hot answers tagged


Your function is defined to accept a jsonb parameter not a record of type my_table. Additionally, the condition after a when has to be enclosed in parentheses. Assuming my_table has a jsonb column called doc you need to change the call to: when (_conditions_form_metadata(new.doc)) Alternatively you need to change _conditions_form_metadata to accept a record ...


With mariadb or mysql upwards from version 8, it would be easier: CREATE TABLE amv ( id varchar(2) primary key, mvc varchar(255) ); INSERT INTO amv VALUES ('ae','[1,2,4,5]'); INSERT INTO amv VALUES ('ac','[1,6]'); Create table bsv as SELECT, FROM amv, Json_table(amv.mvc, "$[*]" COLUMNS(sv int path '$')) jt; See ...


Since there's been some ongoing interest to this and years later I've become quite well acquainted with all of the above, here's a short summary in performance terms: I did a test on some version of SQL Server 2016 involving inserting, updating, and deleting 10000 rows from 40 different types of tables one by one, and charted the overall time spent, basic ...


If someone like me end up in this old question, nowadays loadable function were created. According to the documentation Use the loadable function interface. A loadable function is compiled as a library file and then loaded and unloaded from the server dynamically using the CREATE FUNCTION and DROP FUNCTION statements.

Only top voted, non community-wiki answers of a minimum length are eligible