CREATE CONVERSION 中文man頁面

2021-01-10 51cto

NAME

CREATE CONVERSION - 定義一個用戶定義的碼制轉換

SYNOPSIS

CREATE [DEFAULT] CONVERSION name FOR source_encoding TO dest_encoding FROM funcname

DESCRIPTION 描述

CREATE CONVERSION 定義一種新的編碼轉換。 轉換的名字可以用在 convert 函數內部聲明特定的編碼轉換。 同樣,標記為 DEFAULT 的轉換可以用於在前端和後端之間的自動編碼轉換。 出於這個原因,我們必須定義兩種轉換,從編碼 A 到 B 以及從編碼 B 到 A。


 為了可以創建轉換,你必須在函數上有EXECUTE權限並且有在目標模式上的CREATE權限。  

PARAMETERS 參數DEFAULT DEFAULT 子句表示這種轉換對於從這種源編碼到目的編碼的情況是預設的。在一個模式裡每個編碼對應該只有一個預設編碼。 name
 轉換的名字。轉換名可以用模式修飾。如果沒有,那麼轉換就在當前模式中定義。轉換名在一個模式裡必須唯一。 source_encoding
 源編碼名。 dest_encoding
 目的編碼名。 funcname
 用於執行轉換的函數。這個函數名可以用模式名修飾。 如果沒有,那麼將從路徑中找出這個函數。


 此函數必須有如下的樣子:

conv_proc( integer, -- 源編碼 ID integer, -- 目的編碼 ID cstring, -- 源字串(空結尾的 C 字串) cstring, -- 目的字串(空結尾的 C 字串) integer -- 源字串長度) RETURNS void;

NOTES 注意


 使用 DROP CONVERSION 刪除用戶定義的轉換。


 創建轉換所需要的權限可能在未來的版本中改變。  

EXAMPLES 例子


 用 myfunc 創建一個從編碼 UNICODE 到 LATIN1 的轉換:

CREATE CONVERSION myconv FOR 'UNICODE' TO 'LATIN1' FROM myfunc;

COMPATIBILITY 兼容性

CREATE CONVERSION 是 PostgreSQL 的擴展。 在 SQL 標準裡沒有CREATE CONVERSION 語句。  

SEE ALSO 參見

ALTER CONVERSION [alter_conversion(7)], CREATE FUNCTION [create_function(l)], DROP CONVERSION [drop_conversion(l)]  

NAME

CREATE CONVERSION - define a new conversion

SYNOPSIS

CREATE [DEFAULT] CONVERSION name FOR source_encoding TO dest_encoding FROM funcname

DESCRIPTION

CREATE CONVERSION defines a new encoding conversion. Conversion names may be used in the convert function to specify a particular encoding conversion. Also, conversions that are marked DEFAULT can be used for automatic encoding conversion between client and server. For this purpose, two conversions, from encoding A to B and from encoding B to A, must be defined.

To be able to create a conversion, you must have EXECUTE privilege on the function and CREATE privilege on the destination schema.  

PARAMETERSDEFAULT The DEFAULT clause indicates that this conversion is the default for this particular source to destination encoding. There should be only one default encoding in a schema for the encoding pair. name The name of the conversion. The conversion name may be schema-qualified. If it is not, the conversion is defined in the current schema. The conversion name must be unique within a schema. source_encoding The source encoding name. dest_encoding The destination encoding name. funcname The function used to perform the conversion. The function name may be schema-qualified. If it is not, the function will be looked up in the path.

The function must have the following signature:

conv_proc( integer, -- source encoding ID integer, -- destination encoding ID cstring, -- source string (null terminated C string) cstring, -- destination string (null terminated C string) integer -- source string length) RETURNS void;

NOTES

Use DROP CONVERSION to remove user-defined conversions.

The privileges required to create a conversion may be changed in a future release.  

EXAMPLES

To create a conversion from encoding UNICODE to LATIN1 using myfunc:

CREATE CONVERSION myconv FOR 'UNICODE' TO 'LATIN1' FROM myfunc;

COMPATIBILITY

CREATE CONVERSION is a PostgreSQL extension. There is no CREATE CONVERSION statement in the SQL standard.  

SEE ALSO

ALTER CONVERSION [alter_conversion(7)], CREATE FUNCTION [create_function(l)], DROP CONVERSION [drop_conversion(l)]

【責任編輯:

韓亞珊

TEL:(010)68476606】

相關焦點

  • DROP INDEX 中文man頁面
    DROP INDEX 中文man頁面 DROP INDEX 從資料庫中刪除一個現存的索引。 要執行這個命令,你必須是索引的所有者。SEE ALSO 參見CREATE INDEX [create_index(7)]NAMEDROP INDEX - remove an indexSYNOPSISDROP INDEX name [, ...] [ CASCADE | RESTRICT ]DESCRIPTIONDROP INDEX drops an existing index
  • CLOSE 中文man頁面
    CLOSE 中文man頁面 CLOSE 釋放和一個遊標關聯的資源。 一個遊標關閉後,不允許對其再做任何操作。一個不再使用的遊標應該關閉掉。
  • START TRANSACTION 中文man頁面
    START TRANSACTION 中文man頁面 這條命令開始一個新的事務。如果聲明了隔離級別或者讀寫模式, 那麼新事務就使用這個特性,如同執行了 SET TRANSACTION [set_transaction(7)] 一樣。
  • pppd 中文man頁面
    Pppd will create a file named ppp-name.pid in /var/run (or /etc/ppp on some systems) containing its process ID.
  • stdout 中文man頁面
  • setvbuf 中文man頁面
  • modinfo 中文man頁面
  • grep 中文man頁面
  • Damascene conversion
    Reader question:Please explain 「Damascene conversion」 in the following passages (The Wisdom of King, John Cassidy
  • eMule-Project站點增加簡體中文頁面
    感謝阿pp的投遞:簡體中文作業系統用戶上eMule-project網站會被自動轉到簡體用戶頁面了.eMule-project
  • 首發中文?SE《復聯》遊戲新作上線中文倒計時頁面 - 3DMGAME
    而今日我們可以發現Square Enix赫然上線了遊戲的中文網站,並顯眼的給出了遊戲公布的倒計時,且該頁面支持簡體中文和繁體中文切換,這是否意味著此次的《漫威復仇者聯盟》官中已經給安排上了?
  • 模擬建造新遊《叢林之屋》上架Steam頁面 支持中文
    模擬建造新遊《叢林之屋》上架Steam頁面 支持中文 時間:2020-07-03 09:05:33 來源:Steam
  • 《賽博朋克2077》三張4K截圖 中文官網頁面更新
    《賽博朋克2077》三張4K截圖 中文官網頁面更新 《賽博朋克2077》三張4K截圖 中文官網頁面更新
  • No man is an island是什麼意思?
    No man is an island的英語能力口語訓練No man is an island是什麼意思?我們還是先用英語No man is an island做「把學過的英語用起來」「見英語說英語」的能力訓練吧。我不要你見英語No man is an island能「說」中文的能力,也不需要你今天學了英語No man is an island明天就有機會跟人說英語No man is an island(沒有人是座孤島)。
  • 首批火星地形地貌中文推薦譯名 中國天文學會官網可視化頁面入口地址
    首頁 > 動態 > 關鍵詞 > 火星最新資訊 > 正文 首批火星地形地貌中文推薦譯名 中國天文學會官網可視化頁面入口地址
  • 把英語讀成英語的能力:a man of importance什麼意思?
    把英語讀成英語的能力:a man of importance什麼意思?一、什麼是「英語閱讀」英能力訓練?這個能力是什麼?我們說的這個能力就是你閱讀時「對著英語說英語」的能力,而不是「對著英語說中文」。這個不叫做英語閱讀,這個叫做中文閱讀。二、注意英語詞彙裡有一種詞性轉換的現象。
  • 美國人說的I'm a man of my word是什麼意思?
    美國人說的I'm a man of my word是什麼意思?我們所有的「英語閱讀」,都可以歸結為回答一個問題:你的「英語閱讀」指的就是用中文「讀懂」英語,用中文意思去「懂得」英語在說什麼嗎?一、下面的英語a man of word時,你是讀」成中文,還是英語?1. Bob, I'm a man of my word.
  • 英語口語:one man's meat is another's poison
    英語口語:one man's meat is another's poison1) 把英語one man's meat is another's poison翻譯成中文理解,是「學習英語」:你終於「用」中文懂得英語one man's meat is another's poison
  • The Nature of Man: Technology and Technique
    a quick trip to Pitti Uomo in Florence, I realised that new attitudes and demands are sweeping away the neat tailored clothes and colourful mix-and-match neckties that once formed the foundation of a man