pg_dump: Remove obsolete trigger support

Started by Peter Eisentrautover 2 years ago4 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

In 30e7c175b81, support for pre-9.2 servers was removed from pg_dump.
But I found that a lot of dead code was left for supporting dumping
triggers from those old versions, presumably because that code was not
behind straightforward versioned "if" branches. This patch removes the
rest of the unneeded code.

Attachments:

0001-pg_dump-Remove-obsolete-trigger-support.patchtext/plain; charset=UTF-8; name=0001-pg_dump-Remove-obsolete-trigger-support.patchDownload+2-203
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: pg_dump: Remove obsolete trigger support

Peter Eisentraut <peter@eisentraut.org> writes:

In 30e7c175b81, support for pre-9.2 servers was removed from pg_dump.
But I found that a lot of dead code was left for supporting dumping
triggers from those old versions, presumably because that code was not
behind straightforward versioned "if" branches. This patch removes the
rest of the unneeded code.

Hm, you're right, we can depend on pg_get_triggerdef in all cases now.
However, the patch looks a little incomplete: you did not remove
fetching of all of the now-unneeded values from the SQL queries.

regards, tom lane

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#2)
Re: pg_dump: Remove obsolete trigger support

On 09.01.24 16:27, Tom Lane wrote:

Peter Eisentraut <peter@eisentraut.org> writes:

In 30e7c175b81, support for pre-9.2 servers was removed from pg_dump.
But I found that a lot of dead code was left for supporting dumping
triggers from those old versions, presumably because that code was not
behind straightforward versioned "if" branches. This patch removes the
rest of the unneeded code.

Hm, you're right, we can depend on pg_get_triggerdef in all cases now.
However, the patch looks a little incomplete: you did not remove
fetching of all of the now-unneeded values from the SQL queries.

I think all the remaining SQL queries only select the fields that are
needed. The now-unneeded values were only selected by queries that are
being deleted. If I missed something, an example would help me.

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: pg_dump: Remove obsolete trigger support

I wrote:

However, the patch looks a little incomplete: you did not remove
fetching of all of the now-unneeded values from the SQL queries.

Oh, scratch that, I now see that we already did that query
optimization.

regards, tom lane