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
93e1f5de
Commit
93e1f5de
authored
Jul 05, 2000
by
Jan Wieck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically create toast tables on ALTER TABLE ... ADD COLUMN
and SELECT ... INTO ... too. Jan
parent
030962da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
src/backend/commands/command.c
src/backend/commands/command.c
+21
-1
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+7
-1
No files found.
src/backend/commands/command.c
View file @
93e1f5de
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.8
4 2000/07/05 12:45:25
wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.8
5 2000/07/05 13:22:23
wieck Exp $
*
* NOTES
* The PerformAddAttribute() code, like most of the relation
...
...
@@ -471,6 +471,13 @@ AlterTableAddColumn(const char *relationName,
heap_freetuple
(
reltup
);
heap_close
(
rel
,
NoLock
);
/*
* Automatically create the secondary relation for TOAST
* if it formerly had no such but now has toastable attributes.
*/
CommandCounterIncrement
();
AlterTableCreateToastTable
(
relationName
,
true
);
}
...
...
@@ -1255,6 +1262,7 @@ AlterTableCreateToastTable(const char *relationName, bool silent)
{
heap_close
(
rel
,
NoLock
);
heap_close
(
class_rel
,
NoLock
);
heap_freetuple
(
reltup
);
return
;
}
...
...
@@ -1276,8 +1284,18 @@ AlterTableCreateToastTable(const char *relationName, bool silent)
}
if
(((
Form_pg_class
)
GETSTRUCT
(
reltup
))
->
reltoastrelid
!=
InvalidOid
)
{
if
(
silent
)
{
heap_close
(
rel
,
NoLock
);
heap_close
(
class_rel
,
NoLock
);
heap_freetuple
(
reltup
);
return
;
}
elog
(
ERROR
,
"ALTER TABLE: relation
\"
%s
\"
already has a toast table"
,
relationName
);
}
/*
* Create the toast table and its index
...
...
@@ -1348,6 +1366,8 @@ AlterTableCreateToastTable(const char *relationName, bool silent)
heap_close
(
class_rel
,
NoLock
);
heap_close
(
rel
,
NoLock
);
CommandCounterIncrement
();
}
...
...
src/backend/executor/execMain.c
View file @
93e1f5de
...
...
@@ -27,7 +27,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.1
19 2000/07/04 06:11:33 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.1
20 2000/07/05 13:22:25 wieck
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -35,6 +35,7 @@
#include "access/heapam.h"
#include "catalog/heap.h"
#include "commands/command.h"
#include "commands/trigger.h"
#include "executor/execdebug.h"
#include "executor/execdefs.h"
...
...
@@ -892,6 +893,11 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
*/
CommandCounterIncrement
();
/*
* Eventually create a TOAST table for the into relation
*/
AlterTableCreateToastTable
(
intoName
,
true
);
intoRelationDesc
=
heap_open
(
intoRelationId
,
AccessExclusiveLock
);
}
...
...
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