Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
postgresql-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Service Desk
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
PostgreSQL
postgresql-common
Commits
d9139f77
Commit
d9139f77
authored
2 months ago
by
Christoph Berg
Browse files
Options
Downloads
Patches
Plain Diff
debian/maintscripts-functions: Create "main" cluster only when no other clusters exist yet.
parent
044a63fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
createcluster.conf
+2
-1
2 additions, 1 deletion
createcluster.conf
debian/changelog
+2
-0
2 additions, 0 deletions
debian/changelog
debian/maintscripts-functions
+28
-16
28 additions, 16 deletions
debian/maintscripts-functions
pg_createcluster
+2
-1
2 additions, 1 deletion
pg_createcluster
with
34 additions
and
18 deletions
createcluster.conf
+
2
−
1
View file @
d9139f77
...
...
@@ -2,7 +2,8 @@
# Occurrences of '%v' are replaced by the major version number,
# and '%c' by the cluster name. Use '%%' for a literal '%'.
# Create a "main" cluster when a new postgresql-x.y server package is installed
# Create a "main" cluster when a new postgresql-NN server package is installed
# and no clusters exist yet.
#create_main_cluster = true
# Default start.conf value, must be one of "auto", "manual", and "disabled".
...
...
This diff is collapsed.
Click to expand it.
debian/changelog
+
2
−
0
View file @
d9139f77
...
...
@@ -14,6 +14,8 @@ postgresql-common (269) UNRELEASED; urgency=medium
* Remove postgresql-contrib meta package, provide it from postgresql.
* supported-versions: Remove obsolete distribution-detection code.
* postgresql-common.config: Remove deprecation notice for old majors.
* debian/maintscripts-functions: Create "main" cluster only when no other
clusters exist yet.
-- Christoph Berg <myon@debian.org> Thu, 09 Jan 2025 14:25:18 +0100
...
...
This diff is collapsed.
Click to expand it.
debian/maintscripts-functions
+
28
−
16
View file @
d9139f77
...
...
@@ -78,28 +78,37 @@ set_system_locale() {
}
# arguments: <major version> <most recently configured package version>
c
onfigure_version
()
{
c
reate_main_cluster
()
{
VERSION
=
"
$1
"
PKG_VER
=
"
${
3
:-
$1
}
"
# Create a main cluster for given version ($VERSION) if no cluster already exists
# for that version and we are installing from scratch.
[
"
$VERSION
"
]
||
{
echo
"Error: configure_version: need version parameter"
>
&2
;
exit
1
;
}
if
[
!
-d
"/etc/postgresql/
$VERSION
"
]
||
[
-z
"
$(
ls
/etc/postgresql/
$VERSION
)
"
]
||
\
[
-z
"
$(
ls
/etc/postgresql/
$VERSION
/
*
/postgresql.conf 2>/dev/null
)
"
]
;
then
# skip creating the main cluster when this is not the first install, or
# when explicitly disabled ($create is on/off/"")
create
=
$(
pg_conftool /etc/postgresql-common/createcluster.conf show
-bs
create_main_cluster
||
:
)
if
[
-z
"
$2
"
]
&&
[
"
$create
"
!=
"off"
]
;
then
set_system_locale
pg_createcluster
-u
postgres
--no-status
$VERSION
main
||
echo
"Error: could not create default cluster. Please create it manually with
# Skip if this package was configured before
[
"
$2
"
]
&&
return
0
# Skip if any other cluster already exists
[
"
$(
ls
/etc/postgresql/
*
/
*
/postgresql.conf 2>/dev/null
)
"
]
&&
return
0
# Skip if this isn't the newest major installed (assumes other packages are
# unpacked first before this one is configured)
[
"
$(
ls
-v
/usr/lib/postgresql/
*
/bin/postgres |
tail
-n1
)
"
=
"/usr/lib/postgresql/
$VERSION
/bin/postgres"
]
||
return
0
# Skip when disabled explicitly
create
=
$(
pg_conftool /etc/postgresql-common/createcluster.conf show
-bs
create_main_cluster
||
:
)
[
"
$create
"
=
"off"
]
&&
return
0
set_system_locale
pg_createcluster
-u
postgres
--no-status
$VERSION
main
||
echo
"Error: could not create default cluster. Please create it manually with
pg_createcluster
$VERSION
main --start
or a similar command (see 'man pg_createcluster')."
>
&2
fi
fi
}
# arguments: <major version> <most recently configured package version>
configure_version
()
{
VERSION
=
"
$1
"
PKG_VER
=
"
${
3
:-
$1
}
"
[
"
$VERSION
"
]
||
{
echo
"Error: configure_version: need version parameter"
>
&2
;
exit
1
;
}
relink_postmaster_manpages
_link_manpages
"
$VERSION
"
psql.1.gz
"postgresql-client-
$PKG_VER
"
"postgresql-
$PKG_VER
"
"postgresql-contrib-
$PKG_VER
"
...
...
@@ -110,6 +119,9 @@ or a similar command (see 'man pg_createcluster')." >&2
# done with debconf
db_stop
# create cluster
create_main_cluster
"
$VERSION
"
"
$2
"
# update list of packages not to apt-autoremove
/usr/share/postgresql-common/pg_updateaptconfig
...
...
This diff is collapsed.
Click to expand it.
pg_createcluster
+
2
−
1
View file @
d9139f77
...
...
@@ -869,7 +869,8 @@ literal B<%>.
=item B<create_main_cluster> (Default: B<true>)
Create a B<main> cluster when a new postgresql-NN server package is installed.
Create a B<main> cluster when a new postgresql-NN server package is installed
and no clusters exist yet.
=item B<start_conf> (Default: B<auto>)
...
...
This diff is collapsed.
Click to expand it.
Christoph Berg
@myon
mentioned in issue
#19 (closed)
·
2 months ago
mentioned in issue
#19 (closed)
mentioned in issue #19
Toggle commit list
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