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

Commit226e2be

Browse files
committed
More code cleanup for configurable TOAST compression.
Remove unused macro. Fix confusion about whether a TOAST compressionmethod is identified by an OID or a char.Justin PryzbyDiscussion:http://postgr.es/m/20210321235544.GD4203@telsasoft.com
1 parent909b449 commit226e2be

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7847,6 +7847,7 @@ SetIndexStorageProperties(Relation rel, Relation attrelation,
78477847
index_close(indrel, lockmode);
78487848
}
78497849
}
7850+
78507851
/*
78517852
* ALTER TABLE ALTER COLUMN SET STORAGE
78527853
*
@@ -15070,7 +15071,7 @@ ATExecSetCompression(AlteredTableInfo *tab,
1507015071
AttrNumberattnum;
1507115072
char *compression;
1507215073
chartypstorage;
15073-
Oidcmoid;
15074+
charcmethod;
1507415075
ObjectAddress address;
1507515076

1507615077
Assert(IsA(newValue, String));
@@ -15104,10 +15105,10 @@ ATExecSetCompression(AlteredTableInfo *tab,
1510415105
format_type_be(atttableform->atttypid))));
1510515106

1510615107
/* get the attribute compression method. */
15107-
cmoid = GetAttributeCompression(atttableform, compression);
15108+
cmethod = GetAttributeCompression(atttableform, compression);
1510815109

1510915110
/* update pg_attribute entry */
15110-
atttableform->attcompression =cmoid;
15111+
atttableform->attcompression =cmethod;
1511115112
CatalogTupleUpdate(attrel, &tuple->t_self, tuple);
1511215113

1511315114
InvokeObjectPostAlterHook(RelationRelationId,
@@ -15118,7 +15119,7 @@ ATExecSetCompression(AlteredTableInfo *tab,
1511815119
* Apply the change to indexes as well (only for simple index columns,
1511915120
* matching behavior of index.c ConstructTupleDescriptor()).
1512015121
*/
15121-
SetIndexStorageProperties(rel, attrel, attnum,cmoid, '\0', lockmode);
15122+
SetIndexStorageProperties(rel, attrel, attnum,cmethod, '\0', lockmode);
1512215123

1512315124
heap_freetuple(tuple);
1512415125

‎src/include/access/toast_compression.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ typedef enum ToastCompressionId
5050
errdetail("This functionality requires the server to be built with lz4 support."), \
5151
errhint("You need to rebuild PostgreSQL using --with-lz4.")))
5252

53-
#defineIsValidCompression(cm) ((cm) != InvalidCompressionMethod)
54-
5553
#defineIsStorageCompressible(storage) ((storage) != TYPSTORAGE_PLAIN && \
5654
(storage) != TYPSTORAGE_EXTERNAL)
5755

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp