Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ad0169b1
Commit
ad0169b1
authored
Jan 01, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CLUSTER forgot to create a TOAST table for the clustered relation.
parent
9315ff55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
src/backend/commands/cluster.c
src/backend/commands/cluster.c
+17
-6
No files found.
src/backend/commands/cluster.c
View file @
ad0169b1
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.6
0 2000/11/16 22:30:18
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.6
1 2001/01/01 21:35:00
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -29,6 +29,7 @@
#include "catalog/pg_index.h"
#include "catalog/pg_proc.h"
#include "commands/cluster.h"
#include "commands/command.h"
#include "commands/rename.h"
#include "miscadmin.h"
#include "utils/builtins.h"
...
...
@@ -106,8 +107,7 @@ cluster(char *oldrelname, char *oldindexname)
OIDNewHeap
=
copy_heap
(
OIDOldHeap
,
NewHeapName
);
/* To make the new heap visible (which is until now empty). */
CommandCounterIncrement
();
/* We do not need CommandCounterIncrement() because copy_heap did it. */
/*
* Copy the heap data into the new table in the desired order.
...
...
@@ -150,7 +150,7 @@ copy_heap(Oid OIDOldHeap, char *NewName)
/*
* Need to make a copy of the tuple descriptor,
* heap_create_with_catalog modifies it.
*
since
heap_create_with_catalog modifies it.
*/
tupdesc
=
CreateTupleDescCopy
(
OldHeapDesc
);
...
...
@@ -158,8 +158,19 @@ copy_heap(Oid OIDOldHeap, char *NewName)
RELKIND_RELATION
,
false
,
allowSystemTableMods
);
if
(
!
OidIsValid
(
OIDNewHeap
))
elog
(
ERROR
,
"copy_heap: cannot create temporary heap relation"
);
/*
* Advance command counter so that the newly-created
* relation's catalog tuples will be visible to heap_open.
*/
CommandCounterIncrement
();
/*
* If necessary, create a TOAST table for the new relation.
* Note that AlterTableCreateToastTable ends with
* CommandCounterIncrement(), so that the TOAST table will
* be visible for insertion.
*/
AlterTableCreateToastTable
(
NewName
,
true
);
heap_close
(
OldHeap
,
NoLock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment