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
75445c15
Commit
75445c15
authored
May 16, 2019
by
Alvaro Herrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More message style fixes
Discussion:
https://postgr.es/m/20190515183005.GA26486@alvherre.pgsql
parent
3f58cc6d
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
78 additions
and
51 deletions
+78
-51
src/backend/commands/copy.c
src/backend/commands/copy.c
+3
-3
src/backend/commands/publicationcmds.c
src/backend/commands/publicationcmds.c
+1
-1
src/backend/commands/subscriptioncmds.c
src/backend/commands/subscriptioncmds.c
+26
-14
src/backend/commands/tablecmds.c
src/backend/commands/tablecmds.c
+4
-4
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+1
-1
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+4
-3
src/backend/replication/walsender.c
src/backend/replication/walsender.c
+15
-10
src/backend/utils/adt/jsonpath.c
src/backend/utils/adt/jsonpath.c
+2
-1
src/backend/utils/adt/jsonpath_exec.c
src/backend/utils/adt/jsonpath_exec.c
+1
-1
src/backend/utils/adt/jsonpath_scan.l
src/backend/utils/adt/jsonpath_scan.l
+5
-5
src/backend/utils/adt/pg_locale.c
src/backend/utils/adt/pg_locale.c
+6
-4
src/backend/utils/adt/regexp.c
src/backend/utils/adt/regexp.c
+10
-4
No files found.
src/backend/commands/copy.c
View file @
75445c15
...
@@ -2793,7 +2793,7 @@ CopyFrom(CopyState cstate)
...
@@ -2793,7 +2793,7 @@ CopyFrom(CopyState cstate)
{
{
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_FEATURE_NOT_SUPPORTED
),
(
errcode
(
ERRCODE_FEATURE_NOT_SUPPORTED
),
errmsg
(
"cannot perform FREEZE on a partitioned table"
)));
errmsg
(
"cannot perform
COPY
FREEZE on a partitioned table"
)));
}
}
/*
/*
...
@@ -2808,13 +2808,13 @@ CopyFrom(CopyState cstate)
...
@@ -2808,13 +2808,13 @@ CopyFrom(CopyState cstate)
if
(
!
ThereAreNoPriorRegisteredSnapshots
()
||
!
ThereAreNoReadyPortals
())
if
(
!
ThereAreNoPriorRegisteredSnapshots
()
||
!
ThereAreNoReadyPortals
())
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_TRANSACTION_STATE
),
(
errcode
(
ERRCODE_INVALID_TRANSACTION_STATE
),
errmsg
(
"cannot perform FREEZE because of prior transaction activity"
)));
errmsg
(
"cannot perform
COPY
FREEZE because of prior transaction activity"
)));
if
(
cstate
->
rel
->
rd_createSubid
!=
GetCurrentSubTransactionId
()
&&
if
(
cstate
->
rel
->
rd_createSubid
!=
GetCurrentSubTransactionId
()
&&
cstate
->
rel
->
rd_newRelfilenodeSubid
!=
GetCurrentSubTransactionId
())
cstate
->
rel
->
rd_newRelfilenodeSubid
!=
GetCurrentSubTransactionId
())
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE
),
(
errcode
(
ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE
),
errmsg
(
"cannot perform FREEZE because the table was not created or truncated in the current subtransaction"
)));
errmsg
(
"cannot perform
COPY
FREEZE because the table was not created or truncated in the current subtransaction"
)));
ti_options
|=
TABLE_INSERT_FROZEN
;
ti_options
|=
TABLE_INSERT_FROZEN
;
}
}
...
...
src/backend/commands/publicationcmds.c
View file @
75445c15
...
@@ -129,7 +129,7 @@ parse_publication_options(List *options,
...
@@ -129,7 +129,7 @@ parse_publication_options(List *options,
else
else
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"unrecognized publication parameter:
%s
"
,
defel
->
defname
)));
errmsg
(
"unrecognized publication parameter:
\"
%s
\"
"
,
defel
->
defname
)));
}
}
}
}
...
...
src/backend/commands/subscriptioncmds.c
View file @
75445c15
...
@@ -185,7 +185,7 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
...
@@ -185,7 +185,7 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
else
else
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"unrecognized subscription parameter:
%s
"
,
defel
->
defname
)));
errmsg
(
"unrecognized subscription parameter:
\"
%s
\"
"
,
defel
->
defname
)));
}
}
/*
/*
...
@@ -198,17 +198,21 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
...
@@ -198,17 +198,21 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
if
(
enabled
&&
*
enabled_given
&&
*
enabled
)
if
(
enabled
&&
*
enabled_given
&&
*
enabled
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"connect = false and enabled = true are mutually exclusive options"
)));
/*- translator: both %s are strings of the form "option = value" */
errmsg
(
"%s and %s are mutually exclusive options"
,
"connect = false"
,
"enabled = true"
)));
if
(
create_slot
&&
create_slot_given
&&
*
create_slot
)
if
(
create_slot
&&
create_slot_given
&&
*
create_slot
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"connect = false and create_slot = true are mutually exclusive options"
)));
errmsg
(
"%s and %s are mutually exclusive options"
,
"connect = false"
,
"create_slot = true"
)));
if
(
copy_data
&&
copy_data_given
&&
*
copy_data
)
if
(
copy_data
&&
copy_data_given
&&
*
copy_data
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"connect = false and copy_data = true are mutually exclusive options"
)));
errmsg
(
"%s and %s are mutually exclusive options"
,
"connect = false"
,
"copy_data = true"
)));
/* Change the defaults of other options. */
/* Change the defaults of other options. */
*
enabled
=
false
;
*
enabled
=
false
;
...
@@ -225,22 +229,28 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
...
@@ -225,22 +229,28 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
if
(
enabled
&&
*
enabled_given
&&
*
enabled
)
if
(
enabled
&&
*
enabled_given
&&
*
enabled
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"slot_name = NONE and enabled = true are mutually exclusive options"
)));
/*- translator: both %s are strings of the form "option = value" */
errmsg
(
"%s and %s are mutually exclusive options"
,
"slot_name = NONE"
,
"enable = true"
)));
if
(
create_slot
&&
create_slot_given
&&
*
create_slot
)
if
(
create_slot
&&
create_slot_given
&&
*
create_slot
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"slot_name = NONE and create_slot = true are mutually exclusive options"
)));
errmsg
(
"%s and %s are mutually exclusive options"
,
"slot_name = NONE"
,
"create_slot = true"
)));
if
(
enabled
&&
!*
enabled_given
&&
*
enabled
)
if
(
enabled
&&
!*
enabled_given
&&
*
enabled
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"subscription with slot_name = NONE must also set enabled = false"
)));
/*- translator: both %s are strings of the form "option = value" */
errmsg
(
"subscription with %s must also set %s"
,
"slot_name = NONE"
,
"enabled = false"
)));
if
(
create_slot
&&
!
create_slot_given
&&
*
create_slot
)
if
(
create_slot
&&
!
create_slot_given
&&
*
create_slot
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"subscription with slot_name = NONE must also set create_slot = false"
)));
errmsg
(
"subscription with %s must also set %s"
,
"slot_name = NONE"
,
"create_slot = false"
)));
}
}
}
}
...
@@ -487,9 +497,9 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
...
@@ -487,9 +497,9 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel)
}
}
else
else
ereport
(
WARNING
,
ereport
(
WARNING
,
(
errmsg
(
"tables were not subscribed, you will have to run "
/* translator: %s is an SQL ALTER statement */
"ALTER SUBSCRIPTION ... REFRESH PUBLICATION to "
(
errmsg
(
"tables were not subscribed, you will have to run %s to subscribe the tables"
,
"
subscribe the tables
"
)));
"
ALTER SUBSCRIPTION ... REFRESH PUBLICATION
"
)));
table_close
(
rel
,
RowExclusiveLock
);
table_close
(
rel
,
RowExclusiveLock
);
...
@@ -673,7 +683,8 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
...
@@ -673,7 +683,8 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
if
(
sub
->
enabled
&&
!
slotname
)
if
(
sub
->
enabled
&&
!
slotname
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
(
errcode
(
ERRCODE_SYNTAX_ERROR
),
errmsg
(
"cannot set slot_name = NONE for enabled subscription"
)));
errmsg
(
"cannot set %s for enabled subscription"
,
"slot_name = NONE"
)));
if
(
slotname
)
if
(
slotname
)
values
[
Anum_pg_subscription_subslotname
-
1
]
=
values
[
Anum_pg_subscription_subslotname
-
1
]
=
...
@@ -981,8 +992,9 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel)
...
@@ -981,8 +992,9 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel)
(
errmsg
(
"could not connect to publisher when attempting to "
(
errmsg
(
"could not connect to publisher when attempting to "
"drop the replication slot
\"
%s
\"
"
,
slotname
),
"drop the replication slot
\"
%s
\"
"
,
slotname
),
errdetail
(
"The error was: %s"
,
err
),
errdetail
(
"The error was: %s"
,
err
),
errhint
(
"Use ALTER SUBSCRIPTION ... SET (slot_name = NONE) "
/* translator: %s is an SQL ALTER command */
"to disassociate the subscription from the slot."
)));
errhint
(
"Use %s to disassociate the subscription from the slot."
,
"ALTER SUBSCRIPTION ... SET (slot_name = NONE)"
)));
PG_TRY
();
PG_TRY
();
{
{
...
...
src/backend/commands/tablecmds.c
View file @
75445c15
...
@@ -15116,14 +15116,14 @@ ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partParams, AttrNu
...
@@ -15116,14 +15116,14 @@ ComputePartitionAttrs(ParseState *pstate, Relation rel, List *partParams, AttrNu
if
(
strategy
==
PARTITION_STRATEGY_HASH
)
if
(
strategy
==
PARTITION_STRATEGY_HASH
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_UNDEFINED_OBJECT
),
(
errcode
(
ERRCODE_UNDEFINED_OBJECT
),
errmsg
(
"data type %s has no default
hash operator class
"
,
errmsg
(
"data type %s has no default
operator class for access method
\"
%s
\"
"
,
format_type_be
(
atttype
)),
format_type_be
(
atttype
)
,
"hash"
),
errhint
(
"You must specify a hash operator class or define a default hash operator class for the data type."
)));
errhint
(
"You must specify a hash operator class or define a default hash operator class for the data type."
)));
else
else
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_UNDEFINED_OBJECT
),
(
errcode
(
ERRCODE_UNDEFINED_OBJECT
),
errmsg
(
"data type %s has no default
btree operator class
"
,
errmsg
(
"data type %s has no default
operator class for access method
\"
%s
\"
"
,
format_type_be
(
atttype
)),
format_type_be
(
atttype
)
,
"btree"
),
errhint
(
"You must specify a btree operator class or define a default btree operator class for the data type."
)));
errhint
(
"You must specify a btree operator class or define a default btree operator class for the data type."
)));
}
}
...
...
src/backend/parser/analyze.c
View file @
75445c15
...
@@ -2599,7 +2599,7 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt)
...
@@ -2599,7 +2599,7 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt)
if
(
stmt
->
into
->
rel
->
relpersistence
==
RELPERSISTENCE_UNLOGGED
)
if
(
stmt
->
into
->
rel
->
relpersistence
==
RELPERSISTENCE_UNLOGGED
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_FEATURE_NOT_SUPPORTED
),
(
errcode
(
ERRCODE_FEATURE_NOT_SUPPORTED
),
errmsg
(
"materialized views cannot be
UNLOGGED
"
)));
errmsg
(
"materialized views cannot be
unlogged
"
)));
/*
/*
* At runtime, we'll need a copy of the parsed-but-not-rewritten Query
* At runtime, we'll need a copy of the parsed-but-not-rewritten Query
...
...
src/backend/postmaster/postmaster.c
View file @
75445c15
...
@@ -2028,7 +2028,7 @@ retry1:
...
@@ -2028,7 +2028,7 @@ retry1:
continue
;
continue
;
ereport
(
COMMERROR
,
ereport
(
COMMERROR
,
(
errcode_for_socket_access
(),
(
errcode_for_socket_access
(),
errmsg
(
"failed to send GSSAPI negotiation response: %m
)
"
)));
errmsg
(
"failed to send GSSAPI negotiation response: %m"
)));
return
STATUS_ERROR
;
/* close the connection */
return
STATUS_ERROR
;
/* close the connection */
}
}
...
@@ -2651,11 +2651,12 @@ SIGHUP_handler(SIGNAL_ARGS)
...
@@ -2651,11 +2651,12 @@ SIGHUP_handler(SIGNAL_ARGS)
/* Reload authentication config files too */
/* Reload authentication config files too */
if
(
!
load_hba
())
if
(
!
load_hba
())
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"pg_hba.conf was not reloaded"
)));
/* translator: %s is a configuration file */
(
errmsg
(
"%s was not reloaded"
,
"pg_hba.conf"
)));
if
(
!
load_ident
())
if
(
!
load_ident
())
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"
pg_ident.conf was not reloaded
"
)));
(
errmsg
(
"
%s was not reloaded"
,
"pg_ident.conf
"
)));
#ifdef USE_SSL
#ifdef USE_SSL
/* Reload SSL configuration as well */
/* Reload SSL configuration as well */
...
...
src/backend/replication/walsender.c
View file @
75445c15
...
@@ -903,8 +903,9 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
...
@@ -903,8 +903,9 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
{
{
if
(
IsTransactionBlock
())
if
(
IsTransactionBlock
())
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"CREATE_REPLICATION_SLOT ... EXPORT_SNAPSHOT "
/*- translator: %s is a CREATE_REPLICATION_SLOT statement */
"must not be called inside a transaction"
)));
(
errmsg
(
"%s must not be called inside a transaction"
,
"CREATE_REPLICATION_SLOT ... EXPORT_SNAPSHOT"
)));
need_full_snapshot
=
true
;
need_full_snapshot
=
true
;
}
}
...
@@ -912,23 +913,27 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
...
@@ -912,23 +913,27 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
{
{
if
(
!
IsTransactionBlock
())
if
(
!
IsTransactionBlock
())
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"CREATE_REPLICATION_SLOT ... USE_SNAPSHOT "
/*- translator: %s is a CREATE_REPLICATION_SLOT statement */
"must be called inside a transaction"
)));
(
errmsg
(
"%s must be called inside a transaction"
,
"CREATE_REPLICATION_SLOT ... USE_SNAPSHOT"
)));
if
(
XactIsoLevel
!=
XACT_REPEATABLE_READ
)
if
(
XactIsoLevel
!=
XACT_REPEATABLE_READ
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"CREATE_REPLICATION_SLOT ... USE_SNAPSHOT "
/*- translator: %s is a CREATE_REPLICATION_SLOT statement */
"must be called in REPEATABLE READ isolation mode transaction"
)));
(
errmsg
(
"%s must be called in REPEATABLE READ isolation mode transaction"
,
"CREATE_REPLICATION_SLOT ... USE_SNAPSHOT"
)));
if
(
FirstSnapshotSet
)
if
(
FirstSnapshotSet
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"CREATE_REPLICATION_SLOT ... USE_SNAPSHOT "
/*- translator: %s is a CREATE_REPLICATION_SLOT statement */
"must be called before any query"
)));
(
errmsg
(
"%s must be called before any query"
,
"CREATE_REPLICATION_SLOT ... USE_SNAPSHOT"
)));
if
(
IsSubTransaction
())
if
(
IsSubTransaction
())
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"CREATE_REPLICATION_SLOT ... USE_SNAPSHOT "
/*- translator: %s is a CREATE_REPLICATION_SLOT statement */
"must not be called in a subtransaction"
)));
(
errmsg
(
"%s must not be called in a subtransaction"
,
"CREATE_REPLICATION_SLOT ... USE_SNAPSHOT"
)));
need_full_snapshot
=
true
;
need_full_snapshot
=
true
;
}
}
...
...
src/backend/utils/adt/jsonpath.c
View file @
75445c15
...
@@ -179,7 +179,8 @@ jsonPathFromCstring(char *in, int len)
...
@@ -179,7 +179,8 @@ jsonPathFromCstring(char *in, int len)
if
(
!
jsonpath
)
if
(
!
jsonpath
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
errmsg
(
"invalid input syntax for jsonpath:
\"
%s
\"
"
,
in
)));
errmsg
(
"invalid input syntax for type %s:
\"
%s
\"
"
,
"jsonpath"
,
in
)));
flattenJsonPathParseItem
(
&
buf
,
jsonpath
->
expr
,
0
,
false
);
flattenJsonPathParseItem
(
&
buf
,
jsonpath
->
expr
,
0
,
false
);
...
...
src/backend/utils/adt/jsonpath_exec.c
View file @
75445c15
...
@@ -1934,7 +1934,7 @@ getJsonPathVariable(JsonPathExecContext *cxt, JsonPathItem *variable,
...
@@ -1934,7 +1934,7 @@ getJsonPathVariable(JsonPathExecContext *cxt, JsonPathItem *variable,
{
{
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_UNDEFINED_OBJECT
),
(
errcode
(
ERRCODE_UNDEFINED_OBJECT
),
errmsg
(
"c
an
not find jsonpath variable
\"
%s
\"
"
,
errmsg
(
"c
ould
not find jsonpath variable
\"
%s
\"
"
,
pnstrdup
(
varName
,
varNameLength
))));
pnstrdup
(
varName
,
varNameLength
))));
}
}
...
...
src/backend/utils/adt/jsonpath_scan.l
View file @
75445c15
...
@@ -539,7 +539,7 @@ addUnicodeChar(int ch)
...
@@ -539,7 +539,7 @@ addUnicodeChar(int ch)
{
{
ereport(ERROR,
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type jsonpath"),
errmsg("invalid input syntax for type
%s", "
jsonpath"),
errdetail("Unicode escape values cannot be used for code "
errdetail("Unicode escape values cannot be used for code "
"point values above 007F when the server encoding "
"point values above 007F when the server encoding "
"is not UTF8.")));
"is not UTF8.")));
...
@@ -555,7 +555,7 @@ addUnicode(int ch, int *hi_surrogate)
...
@@ -555,7 +555,7 @@ addUnicode(int ch, int *hi_surrogate)
if (*hi_surrogate != -1)
if (*hi_surrogate != -1)
ereport(ERROR,
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type jsonpath"),
errmsg("invalid input syntax for type
%s", "
jsonpath"),
errdetail("Unicode high surrogate must not follow "
errdetail("Unicode high surrogate must not follow "
"a high surrogate.")));
"a high surrogate.")));
*hi_surrogate = (ch & 0x3ff) << 10;
*hi_surrogate = (ch & 0x3ff) << 10;
...
@@ -566,7 +566,7 @@ addUnicode(int ch, int *hi_surrogate)
...
@@ -566,7 +566,7 @@ addUnicode(int ch, int *hi_surrogate)
if (*hi_surrogate == -1)
if (*hi_surrogate == -1)
ereport(ERROR,
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type jsonpath"),
errmsg("invalid input syntax for type
%s", "
jsonpath"),
errdetail("Unicode low surrogate must follow a high "
errdetail("Unicode low surrogate must follow a high "
"surrogate.")));
"surrogate.")));
ch = 0x10000 + *hi_surrogate + (ch & 0x3ff);
ch = 0x10000 + *hi_surrogate + (ch & 0x3ff);
...
@@ -576,7 +576,7 @@ addUnicode(int ch, int *hi_surrogate)
...
@@ -576,7 +576,7 @@ addUnicode(int ch, int *hi_surrogate)
{
{
ereport(ERROR,
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type jsonpath"),
errmsg("invalid input syntax for type
%s", "
jsonpath"),
errdetail("Unicode low surrogate must follow a high "
errdetail("Unicode low surrogate must follow a high "
"surrogate.")));
"surrogate.")));
}
}
...
@@ -618,7 +618,7 @@ parseUnicode(char *s, int l)
...
@@ -618,7 +618,7 @@ parseUnicode(char *s, int l)
{
{
ereport(ERROR,
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type jsonpath"),
errmsg("invalid input syntax for type
%s", "
jsonpath"),
errdetail("Unicode low surrogate must follow a high "
errdetail("Unicode low surrogate must follow a high "
"surrogate.")));
"surrogate.")));
}
}
...
...
src/backend/utils/adt/pg_locale.c
View file @
75445c15
...
@@ -1603,7 +1603,7 @@ icu_to_uchar(UChar **buff_uchar, const char *buff, size_t nbytes)
...
@@ -1603,7 +1603,7 @@ icu_to_uchar(UChar **buff_uchar, const char *buff, size_t nbytes)
buff
,
nbytes
,
&
status
);
buff
,
nbytes
,
&
status
);
if
(
U_FAILURE
(
status
)
&&
status
!=
U_BUFFER_OVERFLOW_ERROR
)
if
(
U_FAILURE
(
status
)
&&
status
!=
U_BUFFER_OVERFLOW_ERROR
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"
ucnv_toUChars failed: %
s"
,
u_errorName
(
status
))));
(
errmsg
(
"
%s failed: %s"
,
"ucnv_toUChar
s"
,
u_errorName
(
status
))));
*
buff_uchar
=
palloc
((
len_uchar
+
1
)
*
sizeof
(
**
buff_uchar
));
*
buff_uchar
=
palloc
((
len_uchar
+
1
)
*
sizeof
(
**
buff_uchar
));
...
@@ -1612,7 +1612,7 @@ icu_to_uchar(UChar **buff_uchar, const char *buff, size_t nbytes)
...
@@ -1612,7 +1612,7 @@ icu_to_uchar(UChar **buff_uchar, const char *buff, size_t nbytes)
buff
,
nbytes
,
&
status
);
buff
,
nbytes
,
&
status
);
if
(
U_FAILURE
(
status
))
if
(
U_FAILURE
(
status
))
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"
ucnv_toUChars failed: %
s"
,
u_errorName
(
status
))));
(
errmsg
(
"
%s failed: %s"
,
"ucnv_toUChar
s"
,
u_errorName
(
status
))));
return
len_uchar
;
return
len_uchar
;
}
}
...
@@ -1641,7 +1641,8 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
...
@@ -1641,7 +1641,8 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
buff_uchar
,
len_uchar
,
&
status
);
buff_uchar
,
len_uchar
,
&
status
);
if
(
U_FAILURE
(
status
)
&&
status
!=
U_BUFFER_OVERFLOW_ERROR
)
if
(
U_FAILURE
(
status
)
&&
status
!=
U_BUFFER_OVERFLOW_ERROR
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"ucnv_fromUChars failed: %s"
,
u_errorName
(
status
))));
(
errmsg
(
"%s failed: %s"
,
"ucnv_fromUChars"
,
u_errorName
(
status
))));
*
result
=
palloc
(
len_result
+
1
);
*
result
=
palloc
(
len_result
+
1
);
...
@@ -1650,7 +1651,8 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
...
@@ -1650,7 +1651,8 @@ icu_from_uchar(char **result, const UChar *buff_uchar, int32_t len_uchar)
buff_uchar
,
len_uchar
,
&
status
);
buff_uchar
,
len_uchar
,
&
status
);
if
(
U_FAILURE
(
status
))
if
(
U_FAILURE
(
status
))
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errmsg
(
"ucnv_fromUChars failed: %s"
,
u_errorName
(
status
))));
(
errmsg
(
"%s failed: %s"
,
"ucnv_fromUChars"
,
u_errorName
(
status
))));
return
len_result
;
return
len_result
;
}
}
...
...
src/backend/utils/adt/regexp.c
View file @
75445c15
...
@@ -423,7 +423,7 @@ parse_re_flags(pg_re_flags *flags, text *opts)
...
@@ -423,7 +423,7 @@ parse_re_flags(pg_re_flags *flags, text *opts)
default:
default:
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
errmsg
(
"invalid reg
exp
option:
\"
%c
\"
"
,
errmsg
(
"invalid reg
ular expression
option:
\"
%c
\"
"
,
opt_p
[
i
])));
opt_p
[
i
])));
break
;
break
;
}
}
...
@@ -920,7 +920,9 @@ regexp_match(PG_FUNCTION_ARGS)
...
@@ -920,7 +920,9 @@ regexp_match(PG_FUNCTION_ARGS)
if
(
re_flags
.
glob
)
if
(
re_flags
.
glob
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
errmsg
(
"regexp_match does not support the global option"
),
/* translator: %s is a SQL function name */
errmsg
(
"%s does not support the
\"
global
\"
option"
,
"regexp_match()"
),
errhint
(
"Use the regexp_matches function instead."
)));
errhint
(
"Use the regexp_matches function instead."
)));
matchctx
=
setup_regexp_matches
(
orig_str
,
pattern
,
&
re_flags
,
matchctx
=
setup_regexp_matches
(
orig_str
,
pattern
,
&
re_flags
,
...
@@ -1298,7 +1300,9 @@ regexp_split_to_table(PG_FUNCTION_ARGS)
...
@@ -1298,7 +1300,9 @@ regexp_split_to_table(PG_FUNCTION_ARGS)
if
(
re_flags
.
glob
)
if
(
re_flags
.
glob
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
errmsg
(
"regexp_split_to_table does not support the global option"
)));
/* translator: %s is a SQL function name */
errmsg
(
"%s does not support the
\"
global
\"
option"
,
"regexp_split_to_table()"
)));
/* But we find all the matches anyway */
/* But we find all the matches anyway */
re_flags
.
glob
=
true
;
re_flags
.
glob
=
true
;
...
@@ -1351,7 +1355,9 @@ regexp_split_to_array(PG_FUNCTION_ARGS)
...
@@ -1351,7 +1355,9 @@ regexp_split_to_array(PG_FUNCTION_ARGS)
if
(
re_flags
.
glob
)
if
(
re_flags
.
glob
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
errmsg
(
"regexp_split_to_array does not support the global option"
)));
/* translator: %s is a SQL function name */
errmsg
(
"%s does not support the
\"
global
\"
option"
,
"regexp_split_to_array()"
)));
/* But we find all the matches anyway */
/* But we find all the matches anyway */
re_flags
.
glob
=
true
;
re_flags
.
glob
=
true
;
...
...
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