不要怂,就是干,撸起袖子干!

Commit dad54ad6 by Mick Hansen

whoops

1 parent 63d5c3c9
Showing with 2 additions and 2 deletions
...@@ -204,8 +204,8 @@ module.exports = (function() { ...@@ -204,8 +204,8 @@ module.exports = (function() {
// pg_temp functions are private per connection, so we never risk this function interfering with another one. // pg_temp functions are private per connection, so we never risk this function interfering with another one.
// <= 9.1 // <= 9.1
options.exception = 'WHEN unique_violation THEN NULL;'; //options.exception = 'WHEN unique_violation THEN NULL;';
valueQuery = 'CREATE OR REPLACE FUNCTION pg_temp.testfunc() RETURNS SETOF <%= table %> AS $body$ BEGIN RETURN QUERY ' + valueQuery + '; EXCEPTION ' + options.exception + ' END; $body$ LANGUAGE plpgsql; SELECT * FROM pg_temp.testfunc(); DROP FUNCTION IF EXISTS pg_temp.testfunc();'; //valueQuery = 'CREATE OR REPLACE FUNCTION pg_temp.testfunc() RETURNS SETOF <%= table %> AS $body$ BEGIN RETURN QUERY ' + valueQuery + '; EXCEPTION ' + options.exception + ' END; $body$ LANGUAGE plpgsql; SELECT * FROM pg_temp.testfunc(); DROP FUNCTION IF EXISTS pg_temp.testfunc();';
// >= 9.2 // >= 9.2
options.exception = 'WHEN unique_violation THEN GET STACKED DIAGNOSTICS sequelize_caught_exception = PG_EXCEPTION_DETAIL;'; options.exception = 'WHEN unique_violation THEN GET STACKED DIAGNOSTICS sequelize_caught_exception = PG_EXCEPTION_DETAIL;';
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!