Prefer TG_TABLE_NAME over TG_RELNAME in tests

Started by Daniel Gustafssonalmost 6 years ago6 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t42978
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 28, 2026 at 02:26 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t42978_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t42978_1 && git checkout t42978_1

Patchset v1 (message #1) is on t42978_1

Jump to latest
#1Daniel Gustafsson
daniel@yesql.se

TG_RELNAME was marked deprecated in commit 3a9ae3d2068 some 14 years ago, but
we still use it in the triggers test suite (test added in 59b4cef1eb74a a year
before deprecation). Seems about time to move over to TG_TABLE_NAME ourselves,
as TG_RELNAME is still covered by the test added in the deprecation commit.

cheers ./daniel

Attachments:

t42978_1
tg_relname.patchapplication/octet-stream; name=tg_relname.patch; x-unix-mode=0644Download+4-5
#2Michael Paquier
michael@paquier.xyz
In reply to: Daniel Gustafsson (#1)
Re: Prefer TG_TABLE_NAME over TG_RELNAME in tests

On Wed, Sep 23, 2020 at 12:07:14PM +0200, Daniel Gustafsson wrote:

TG_RELNAME was marked deprecated in commit 3a9ae3d2068 some 14 years ago, but
we still use it in the triggers test suite (test added in 59b4cef1eb74a a year
before deprecation). Seems about time to move over to TG_TABLE_NAME ourselves,
as TG_RELNAME is still covered by the test added in the deprecation commit.

No objections from here to remove that from the core tests. It is
worth noting that Debian Code Search hints that this is used in some
extensions:
https://codesearch.debian.net/search?q=TG_RELNAME&literal=1

These are pgformatter, bucardo, sql-ledger, ledgersmb and davical.
--
Michael

#3Magnus Hagander
magnus@hagander.net
In reply to: Michael Paquier (#2)
Re: Prefer TG_TABLE_NAME over TG_RELNAME in tests

On Thu, Sep 24, 2020 at 5:17 AM Michael Paquier <michael@paquier.xyz> wrote:

On Wed, Sep 23, 2020 at 12:07:14PM +0200, Daniel Gustafsson wrote:

TG_RELNAME was marked deprecated in commit 3a9ae3d2068 some 14 years ago, but
we still use it in the triggers test suite (test added in 59b4cef1eb74a a year
before deprecation). Seems about time to move over to TG_TABLE_NAME ourselves,
as TG_RELNAME is still covered by the test added in the deprecation commit.

No objections from here to remove that from the core tests. It is
worth noting that Debian Code Search hints that this is used in some
extensions:
https://codesearch.debian.net/search?q=TG_RELNAME&amp;literal=1

These are pgformatter, bucardo, sql-ledger, ledgersmb and davical.

That's interesting, but I think irrelevant to this patch in itself of
course. But it might be worth reaching out to some of those projects
and notifying them they're using the deprecated ones..

Thus, pushed. Thanks!

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/

#4Andreas Karlsson
andreas.karlsson@percona.com
In reply to: Magnus Hagander (#3)
Re: Prefer TG_TABLE_NAME over TG_RELNAME in tests

On 11/3/20 10:22 AM, Magnus Hagander wrote:

On Thu, Sep 24, 2020 at 5:17 AM Michael Paquier <michael@paquier.xyz> wrote:

No objections from here to remove that from the core tests. It is
worth noting that Debian Code Search hints that this is used in some
extensions:
https://codesearch.debian.net/search?q=TG_RELNAME&amp;literal=1

These are pgformatter, bucardo, sql-ledger, ledgersmb and davical.

That's interesting, but I think irrelevant to this patch in itself of
course. But it might be worth reaching out to some of those projects
and notifying them they're using the deprecated ones..

I submitted patches to pgformatter, bucardo and ledgersmb. Both davical
and sql-ledger only seems to have them in old upgrade scripts.

Andreas

#5Michael Paquier
michael@paquier.xyz
In reply to: Andreas Karlsson (#4)
Re: Prefer TG_TABLE_NAME over TG_RELNAME in tests

On Tue, Nov 10, 2020 at 09:50:15AM +0100, Andreas Karlsson wrote:

I submitted patches to pgformatter, bucardo and ledgersmb. Both davical and
sql-ledger only seems to have them in old upgrade scripts.

Thanks, Andreas!
--
Michael

#6Greg Sabino Mullane
greg@turnstep.com
In reply to: Andreas Karlsson (#4)
Re: Prefer TG_TABLE_NAME over TG_RELNAME in tests

Thanks so much: the Bucardo PR has been merged in.