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
502dc6df
Commit
502dc6df
authored
Apr 22, 2021
by
Andrew Dunstan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make PostgresVersion code a bit more robust and simple.
per gripe from Alvaro Herrera.
parent
8aba9322
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
src/test/perl/PostgresVersion.pm
src/test/perl/PostgresVersion.pm
+8
-11
No files found.
src/test/perl/PostgresVersion.pm
View file @
502dc6df
...
...
@@ -34,7 +34,7 @@ PostgresVersion - class representing PostgreSQL version numbers
=head1 DESCRIPTION
PostgresVersion encapsulate
d
Postgres version numbers, providing parsing
PostgresVersion encapsulate
s
Postgres version numbers, providing parsing
of common version formats and comparison operations.
=cut
...
...
@@ -73,25 +73,22 @@ sub new
my
$class
=
shift
;
my
$arg
=
shift
;
chomp
$arg
;
# Accept standard formats, in case caller has handed us the output of a
# postgres command line tool
$arg
=
$1
if
(
$arg
=~
m/\(?PostgreSQL\)? (\d+(?:\.\d+)*(?:devel)?)/
);
my
$devel
;
(
$arg
,
$devel
)
=
(
$1
,
$2
)
if
(
$arg
=~
m/^(?:\(?PostgreSQL\)? )?(\d+(?:\.\d+)*)(devel)?/
);
# Split into an array
my
@result
=
split
(
/\./
,
$arg
);
# Treat development versions as having a minor/micro version one less than
# the first released version of that branch.
if
(
$result
[
$#result
]
=~
m/^(\d+)devel$/
)
{
pop
(
@result
);
push
(
@result
,
$1
,
-
1
);
}
push
@result
,
-
1
if
(
$devel
);
my
$res
=
[
@result
];
bless
$res
,
$class
;
return
$res
;
return
bless
\
@result
,
$class
;
}
...
...
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