diff --git a/CHANGELOG.md b/CHANGELOG.md index e20f95a..9447e78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,12 @@ Version 0.13 - file_link() now throws an error if path doesn't have a valid volume prefix - improved datalinker, also reads volumes from /etc/postgresql-common/pg_datalinker.prefix - datalinker prefixes can be managed with `pg_datalinker ( init, list, add, del )` command -- datalinker can now revert old files from backups +- datalinker can now revert old files from backups when assigning datalinks with tokens - datalinker can now unlink+link in one operation - trim trailing / on directory names for FS datalinks for better file name uniqueness - dlnewcopy() now stores old token in link - dlpreviouscopy() looks for this old token first +- store curl_head response code in datalink. This helps in finding broken links and such. Version 0.12 ------------ diff --git a/datalink.sql b/datalink.sql index 9b349c5..037c245 100644 --- a/datalink.sql +++ b/datalink.sql @@ -1106,8 +1106,8 @@ begin if not found then raise exception 'datalink exception' using errcode = 'HW000', - detail = format('Invalid link control options (%s)',my_lco), - hint = 'see table datalink.link_control_options for valid link control options'; + detail = format('Invalid link control options (%s)',my_lco), + hint = 'see table datalink.link_control_options for valid link control options'; end if; if my_lco is distinct from co.lco then @@ -1115,7 +1115,10 @@ begin my_column_name,cast(my_regclass as text),my_column_name); execute e into n; if n > 0 then - raise exception 'Can''t change link control options; % non-null values present in column "%"',n,my_column_name; + raise exception 'datalink exception' + using errcode = 'HW000', + detail = format('Can''t change link control options; %s non-null values present in column "%s"',n,my_column_name), + hint = format('Perhaps you can truncate %s',my_regclass); end if; -- update fdw options with new lco diff --git a/test/expected/other.out b/test/expected/other.out index a9f72b3..e4b41df 100644 --- a/test/expected/other.out +++ b/test/expected/other.out @@ -53,7 +53,9 @@ NOTICE: DATALINK DDL:TRIGGER on sample_datalinks3 update datalink.column_options set link_control='FILE', integrity='SELECTIVE' where table_name='sample_datalinks3' and column_name='link'; -ERROR: Can't change link control options; 6 non-null values present in column "link" +ERROR: datalink exception +DETAIL: Can't change link control options; 6 non-null values present in column "link" +HINT: Perhaps you can truncate sample_datalinks3 CONTEXT: PL/pgSQL function modlco(regclass,name,dl_lco) line 35 at RAISE SQL statement "SELECT datalink.modlco(regclass(old.table_name),old.column_name,my_lco)" PL/pgSQL function dl_trigger_options() line 18 at PERFORM