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
a1b14ae1
Commit
a1b14ae1
authored
17 years ago
by
Andrew Dunstan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments re text <-> bytea internal equivalence in convert routines.
parent
82467e4e
REL_14_STABLE
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
src/backend/utils/mb/mbutils.c
src/backend/utils/mb/mbutils.c
+11
-1
No files found.
src/backend/utils/mb/mbutils.c
View file @
a1b14ae1
...
...
@@ -4,7 +4,7 @@
* (currently mule internal code (mic) is used)
* Tatsuo Ishii
*
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.6
5 2007/09/24 14:59:37
adunstan Exp $
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.6
6 2007/09/24 16:38:24
adunstan Exp $
*/
#include "postgres.h"
...
...
@@ -305,6 +305,10 @@ pg_convert_to(PG_FUNCTION_ARGS)
namein
,
CStringGetDatum
(
DatabaseEncoding
->
name
));
Datum
result
;
/* pg_convert expects a bytea as its first argument. We're passing it
* a text argument here, relying on the fact that they are both in fact
* varlena types, and thus structurally identical.
*/
result
=
DirectFunctionCall3
(
pg_convert
,
string
,
src_encoding_name
,
dest_encoding_name
);
...
...
@@ -334,6 +338,12 @@ pg_convert_from(PG_FUNCTION_ARGS)
/* free memory allocated by namein */
pfree
((
void
*
)
src_encoding_name
);
/* pg_convert returns a bytea, which we in turn return as text, relying
* on the fact that they are both in fact varlena types, and thus
* structurally identical. Although not all bytea values are valid text,
* in this case it will be because we've told pg_convert to return one
* that is valid as text in the current database encoding.
*/
PG_RETURN_TEXT_P
(
result
);
}
...
...
This diff is collapsed.
Click to expand it.
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