Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
07d17a73
Commit
07d17a73
authored
13 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
In pg_upgrade, check there are no prepared transactions.
parent
8cfd59dd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/pg_upgrade/check.c
+33
-0
33 additions, 0 deletions
contrib/pg_upgrade/check.c
with
33 additions
and
0 deletions
contrib/pg_upgrade/check.c
+
33
−
0
View file @
07d17a73
...
@@ -16,6 +16,7 @@ static void check_old_cluster_has_new_cluster_dbs(void);
...
@@ -16,6 +16,7 @@ static void check_old_cluster_has_new_cluster_dbs(void);
static
void
check_locale_and_encoding
(
ControlData
*
oldctrl
,
static
void
check_locale_and_encoding
(
ControlData
*
oldctrl
,
ControlData
*
newctrl
);
ControlData
*
newctrl
);
static
void
check_is_super_user
(
ClusterInfo
*
cluster
);
static
void
check_is_super_user
(
ClusterInfo
*
cluster
);
static
void
check_for_prepared_transactions
(
ClusterInfo
*
cluster
);
static
void
check_for_isn_and_int8_passing_mismatch
(
ClusterInfo
*
cluster
);
static
void
check_for_isn_and_int8_passing_mismatch
(
ClusterInfo
*
cluster
);
static
void
check_for_reg_data_type_usage
(
ClusterInfo
*
cluster
);
static
void
check_for_reg_data_type_usage
(
ClusterInfo
*
cluster
);
...
@@ -65,6 +66,7 @@ check_old_cluster(bool live_check,
...
@@ -65,6 +66,7 @@ check_old_cluster(bool live_check,
* Check for various failure cases
* Check for various failure cases
*/
*/
check_is_super_user
(
&
old_cluster
);
check_is_super_user
(
&
old_cluster
);
check_for_prepared_transactions
(
&
old_cluster
);
check_for_reg_data_type_usage
(
&
old_cluster
);
check_for_reg_data_type_usage
(
&
old_cluster
);
check_for_isn_and_int8_passing_mismatch
(
&
old_cluster
);
check_for_isn_and_int8_passing_mismatch
(
&
old_cluster
);
...
@@ -117,6 +119,7 @@ check_new_cluster(void)
...
@@ -117,6 +119,7 @@ check_new_cluster(void)
get_db_and_rel_infos
(
&
new_cluster
);
get_db_and_rel_infos
(
&
new_cluster
);
check_new_cluster_is_empty
();
check_new_cluster_is_empty
();
check_for_prepared_transactions
(
&
new_cluster
);
check_old_cluster_has_new_cluster_dbs
();
check_old_cluster_has_new_cluster_dbs
();
check_loadable_libraries
();
check_loadable_libraries
();
...
@@ -506,6 +509,36 @@ check_is_super_user(ClusterInfo *cluster)
...
@@ -506,6 +509,36 @@ check_is_super_user(ClusterInfo *cluster)
}
}
/*
* check_for_prepared_transactions()
*
* Make sure there are no prepared transactions because the storage format
* might have changed.
*/
static
void
check_for_prepared_transactions
(
ClusterInfo
*
cluster
)
{
PGresult
*
res
;
PGconn
*
conn
=
connectToServer
(
cluster
,
"template1"
);
prep_status
(
"Checking for prepared transactions"
);
res
=
executeQueryOrDie
(
conn
,
"SELECT * "
"FROM pg_catalog.pg_prepared_xact()"
);
if
(
PQntuples
(
res
)
!=
0
)
pg_log
(
PG_FATAL
,
"The %s cluster contains prepared transactions
\n
"
,
CLUSTER_NAME
(
cluster
));
PQclear
(
res
);
PQfinish
(
conn
);
check_ok
();
}
/*
/*
* check_for_isn_and_int8_passing_mismatch()
* check_for_isn_and_int8_passing_mismatch()
*
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment