diff -Nru postgresql-plsh-1.20171014/debian/changelog postgresql-plsh-1.20200522/debian/changelog --- postgresql-plsh-1.20171014/debian/changelog 2019-10-29 08:23:37.000000000 +0000 +++ postgresql-plsh-1.20200522/debian/changelog 2020-06-03 11:48:48.000000000 +0000 @@ -1,3 +1,9 @@ +postgresql-plsh (1.20200522-1) unstable; urgency=medium + + * New upstream version. + + -- Christoph Berg Wed, 03 Jun 2020 13:48:48 +0200 + postgresql-plsh (1.20171014-4) unstable; urgency=medium * Upload for PostgreSQL 12. diff -Nru postgresql-plsh-1.20171014/debian/patches/11-tupdesc postgresql-plsh-1.20200522/debian/patches/11-tupdesc --- postgresql-plsh-1.20171014/debian/patches/11-tupdesc 2018-10-18 12:00:40.000000000 +0000 +++ postgresql-plsh-1.20200522/debian/patches/11-tupdesc 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ ---- a/plsh.c -+++ b/plsh.c -@@ -37,6 +37,10 @@ - #include - #include - -+#if PG_VERSION_NUM < 100000 -+/* from src/include/access/tupdesc.h, introduced in 2cd708452 */ -+#define TupleDescAttr(tupdesc, i) ((tupdesc)->attrs[(i)]) -+#endif - - PG_MODULE_MAGIC; - -@@ -477,10 +481,10 @@ handler_internal(Oid function_oid, Funct - if (isnull) - s = ""; - else -- s = type_to_cstring(attr, tupdesc->attrs[i]->atttypid); -+ s = type_to_cstring(attr, TupleDescAttr(tupdesc, i)->atttypid); - - elog(DEBUG2, "arg %d is \"%s\" (type %u)", i, s, -- tupdesc->attrs[i]->atttypid); -+ TupleDescAttr(tupdesc, i)->atttypid); - - arguments[argc++] = s; - } diff -Nru postgresql-plsh-1.20171014/debian/patches/series postgresql-plsh-1.20200522/debian/patches/series --- postgresql-plsh-1.20171014/debian/patches/series 2018-10-18 11:58:39.000000000 +0000 +++ postgresql-plsh-1.20200522/debian/patches/series 2020-06-03 11:48:48.000000000 +0000 @@ -1,2 +1 @@ regress-create-extension -11-tupdesc diff -Nru postgresql-plsh-1.20171014/NEWS postgresql-plsh-1.20200522/NEWS --- postgresql-plsh-1.20171014/NEWS 2017-10-14 20:44:40.000000000 +0000 +++ postgresql-plsh-1.20200522/NEWS 2020-05-22 19:04:23.000000000 +0000 @@ -1,3 +1,7 @@ +* Version 1.20200522 + +- Works with PostgreSQL 8.4 through 13. + * Version 1.20171014 - Works with PostgreSQL 8.4 through 10. diff -Nru postgresql-plsh-1.20171014/plsh.c postgresql-plsh-1.20200522/plsh.c --- postgresql-plsh-1.20171014/plsh.c 2017-10-14 20:44:40.000000000 +0000 +++ postgresql-plsh-1.20200522/plsh.c 2020-05-22 19:04:23.000000000 +0000 @@ -50,6 +50,11 @@ #endif +#if PG_VERSION_NUM < 110000 && !defined(TupleDescAttr) +#define TupleDescAttr(tupdesc, i) ((tupdesc)->attrs[(i)]) +#endif + + static char * handler_internal2(const char *tempfile, char * const * arguments, const char *proname, TriggerData *trigger_data, EventTriggerData *event_trigger_data); @@ -326,7 +331,13 @@ { #ifdef HAVE_EVENT_TRIGGERS setenv("PLSH_TG_EVENT", evttrigdata->event, 1); - setenv("PLSH_TG_TAG", evttrigdata->tag, 1); + setenv("PLSH_TG_TAG", +#if PG_VERSION_NUM >= 130000 + GetCommandTagName(evttrigdata->tag), +#else + evttrigdata->tag, +#endif + 1); #endif } @@ -477,16 +488,16 @@ if (isnull) s = ""; else - s = type_to_cstring(attr, tupdesc->attrs[i]->atttypid); + s = type_to_cstring(attr, TupleDescAttr(tupdesc, i)->atttypid); elog(DEBUG2, "arg %d is \"%s\" (type %u)", i, s, - tupdesc->attrs[i]->atttypid); + TupleDescAttr(tupdesc, i)->atttypid); arguments[argc++] = s; } /* since we can't alter the tuple anyway, set up a return - tuple right now */ + tuple right now */ if (TRIGGER_FIRED_BY_INSERT(trigdata->tg_event)) returntuple = trigdata->tg_trigtuple; else if (TRIGGER_FIRED_BY_DELETE(trigdata->tg_event)) diff -Nru postgresql-plsh-1.20171014/.travis.yml postgresql-plsh-1.20200522/.travis.yml --- postgresql-plsh-1.20171014/.travis.yml 2017-10-14 20:44:40.000000000 +0000 +++ postgresql-plsh-1.20200522/.travis.yml 2020-05-22 19:04:23.000000000 +0000 @@ -1,16 +1,24 @@ +dist: bionic language: c -before_install: - - wget https://gist.github.com/petere/5893799/raw/apt.postgresql.org.sh - - wget https://gist.github.com/petere/6023944/raw/pg-travis-test.sh - - sudo sh ./apt.postgresql.org.sh +addons: + apt: + sources: + - sourceline: 'deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main' + key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc' + update: true env: - - PGVERSION=8.4 - - PGVERSION=9.0 - - PGVERSION=9.1 - - PGVERSION=9.2 - PGVERSION=9.3 - PGVERSION=9.4 - PGVERSION=9.5 - PGVERSION=9.6 - PGVERSION=10 -script: bash ./pg-travis-test.sh + - PGVERSION=11 + - PGVERSION=12 +script: | + set -e + PATH=/usr/lib/postgresql/$PGVERSION/bin:$PATH + sudo apt-get install postgresql-$PGVERSION postgresql-server-dev-$PGVERSION + sudo pg_createcluster --start $PGVERSION test -p 55435 -- -A trust + make all + sudo make install PG_CONFIG=/usr/lib/postgresql/$PGVERSION/bin/pg_config + PGPORT=55435 make installcheck PGUSER=postgres