This is due to the change described in "Perl Changes for 5.22" but the solution suggested there of escaping the '{' is frequently not the right thing to do, depending on the intended logic of the regex.
This warning occurs when a regex uses a construct like "{,20}" which historically in some OTHER regex implementations has been interpreted as equivalent to "{0,20}", i.e. "a repeating series of the preceding atom, zero to twenty times." In all cases where the intent is to quantify a repeat, this is broken in all modern versions of Perl, because interpretation of '{' followed by anything other than a number as a literal '{' has been explicitly documented since 5.8. Escaping the left brace in the case of an intended quantifier isn't the fix; adding the implied zero is.
Creating config file /etc/logrotate.d/postgresql-common with new version Building PostgreSQL dictionaries from installed myspell/hunspell packages... en_us Removing obsolete dictionary files: Setting up postgresql-9.5 (9.5.11-0ubuntu0.16.04) ... Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\${ <-- HERE ([^}]+)}/ at /usr/sbin/pam_getenv line 78.
Also because @bill-cole's answer is most relevant.