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
cd603a4d
Commit
cd603a4d
authored
Feb 28, 2017
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use SQL standard error code for nextval
parent
be37c212
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
src/backend/commands/sequence.c
src/backend/commands/sequence.c
+2
-2
src/backend/utils/errcodes.txt
src/backend/utils/errcodes.txt
+1
-0
No files found.
src/backend/commands/sequence.c
View file @
cd603a4d
...
@@ -694,7 +694,7 @@ nextval_internal(Oid relid)
...
@@ -694,7 +694,7 @@ nextval_internal(Oid relid)
snprintf
(
buf
,
sizeof
(
buf
),
INT64_FORMAT
,
maxv
);
snprintf
(
buf
,
sizeof
(
buf
),
INT64_FORMAT
,
maxv
);
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_
OBJECT_NOT_IN_PREREQUISITE_STATE
),
(
errcode
(
ERRCODE_
SEQUENCE_GENERATOR_LIMIT_EXCEEDED
),
errmsg
(
"nextval: reached maximum value of sequence
\"
%s
\"
(%s)"
,
errmsg
(
"nextval: reached maximum value of sequence
\"
%s
\"
(%s)"
,
RelationGetRelationName
(
seqrel
),
buf
)));
RelationGetRelationName
(
seqrel
),
buf
)));
}
}
...
@@ -717,7 +717,7 @@ nextval_internal(Oid relid)
...
@@ -717,7 +717,7 @@ nextval_internal(Oid relid)
snprintf
(
buf
,
sizeof
(
buf
),
INT64_FORMAT
,
minv
);
snprintf
(
buf
,
sizeof
(
buf
),
INT64_FORMAT
,
minv
);
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_
OBJECT_NOT_IN_PREREQUISITE_STATE
),
(
errcode
(
ERRCODE_
SEQUENCE_GENERATOR_LIMIT_EXCEEDED
),
errmsg
(
"nextval: reached minimum value of sequence
\"
%s
\"
(%s)"
,
errmsg
(
"nextval: reached minimum value of sequence
\"
%s
\"
(%s)"
,
RelationGetRelationName
(
seqrel
),
buf
)));
RelationGetRelationName
(
seqrel
),
buf
)));
}
}
...
...
src/backend/utils/errcodes.txt
View file @
cd603a4d
...
@@ -188,6 +188,7 @@ Section: Class 22 - Data Exception
...
@@ -188,6 +188,7 @@ Section: Class 22 - Data Exception
22004 E ERRCODE_NULL_VALUE_NOT_ALLOWED null_value_not_allowed
22004 E ERRCODE_NULL_VALUE_NOT_ALLOWED null_value_not_allowed
22002 E ERRCODE_NULL_VALUE_NO_INDICATOR_PARAMETER null_value_no_indicator_parameter
22002 E ERRCODE_NULL_VALUE_NO_INDICATOR_PARAMETER null_value_no_indicator_parameter
22003 E ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE numeric_value_out_of_range
22003 E ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE numeric_value_out_of_range
2200H E ERRCODE_SEQUENCE_GENERATOR_LIMIT_EXCEEDED sequence_generator_limit_exceeded
22026 E ERRCODE_STRING_DATA_LENGTH_MISMATCH string_data_length_mismatch
22026 E ERRCODE_STRING_DATA_LENGTH_MISMATCH string_data_length_mismatch
22001 E ERRCODE_STRING_DATA_RIGHT_TRUNCATION string_data_right_truncation
22001 E ERRCODE_STRING_DATA_RIGHT_TRUNCATION string_data_right_truncation
22011 E ERRCODE_SUBSTRING_ERROR substring_error
22011 E ERRCODE_SUBSTRING_ERROR substring_error
...
...
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