core: Swap apostrophes for $-tag

Older versions of Postgresql, such as the one currently used on RHEL,
would escape the backslashes between apostrophes. Using $-tag prevents
these backslashes being escaped (on both older and newer versions).

Change-Id: Icba1c75cd317589910e64f7ee6237fcb23a346ee
Bug-Url: https://bugzilla.redhat.com/1119214
Signed-off-by: Lior Vernia <lvernia@redhat.com>