Skip to content

Commit 0d1aa5a

Browse files
committed
pg_dump -z was careless about ownership of indexes.
Now it's a little less so.
1 parent f447344 commit 0d1aa5a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*
2323
* IDENTIFICATION
24-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.86 1998/09/23 04:22:14 momjian Exp $
24+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.87 1998/10/01 01:49:12 tgl Exp $
2525
*
2626
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2727
*
@@ -2678,6 +2678,11 @@ dumpIndices(FILE *fout, IndInfo *indinfo, int numIndices,
26782678

26792679
if (!tablename || (!strcmp(indinfo[i].indrelname, tablename)))
26802680
{
2681+
/* We make the index belong to the owner of its table,
2682+
* which is not necessarily right but should answer 99% of the
2683+
* time. Would have to add owner name to IndInfo to do it right.
2684+
*/
2685+
becomeUser(fout, tblinfo[tableInd].usename);
26812686

26822687
strcpy(id1, fmtId(indinfo[i].indexrelname));
26832688
strcpy(id2, fmtId(indinfo[i].indrelname));

0 commit comments

Comments
 (0)