Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbdbe9c9

Browse files
committed
pg_get_indexdef() didn't do quite the right thing with identifying
an index's tablespace.
1 parentca14e3b commitbdbe9c9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

‎src/backend/utils/adt/ruleutils.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*back to source text
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.182 2004/10/07 20:36:52 tgl Exp $
6+
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.183 2004/10/17 21:17:27 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -58,6 +58,7 @@
5858
#include"commands/tablespace.h"
5959
#include"executor/spi.h"
6060
#include"lib/stringinfo.h"
61+
#include"miscadmin.h"
6162
#include"nodes/makefuncs.h"
6263
#include"optimizer/clauses.h"
6364
#include"optimizer/tlist.h"
@@ -777,10 +778,14 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, int prettyFlags)
777778
* If the index is in a different tablespace from its parent, tell
778779
* about that
779780
*/
780-
if (OidIsValid(idxrelrec->reltablespace)&&
781-
idxrelrec->reltablespace!=get_rel_tablespace(indrelid))
781+
if (idxrelrec->reltablespace!=get_rel_tablespace(indrelid))
782782
{
783-
char*spcname=get_tablespace_name(idxrelrec->reltablespace);
783+
char*spcname;
784+
785+
if (OidIsValid(idxrelrec->reltablespace))
786+
spcname=get_tablespace_name(idxrelrec->reltablespace);
787+
else
788+
spcname=get_tablespace_name(MyDatabaseTableSpace);
784789

785790
if (spcname)/* just paranoia... */
786791
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp