1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Fix ALTER TRIGGER ... RENAME, broken in WITH OIDS removal.

I (Andres) broke this in 578b229718.

Author: Rushabh Lathia
Discussion: https://postgr.es/m/CAGPqQf04PywZX3sVQaF6H=oLiW9GJncRW+=e78vTy4MokEWcZw@mail.gmail.com
This commit is contained in:
Andres Freund
2019-01-21 09:12:31 -08:00
parent 93507e67c9
commit 8cc157b234
3 changed files with 25 additions and 5 deletions

View File

@ -1721,14 +1721,14 @@ renametrig(RenameStmt *stmt)
NULL, 2, key);
if (HeapTupleIsValid(tuple = systable_getnext(tgscan)))
{
Form_pg_trigger trigform = (Form_pg_trigger) GETSTRUCT(tuple);
tgoid = trigform->oid;
Form_pg_trigger trigform;
/*
* Update pg_trigger tuple with new tgname.
*/
tuple = heap_copytuple(tuple); /* need a modifiable copy */
trigform = (Form_pg_trigger) GETSTRUCT(tuple);
tgoid = trigform->oid;
namestrcpy(&trigform->tgname,
stmt->newname);