In the object hierarchy of every schema are conversions. You can add conversions by selecting CREATE CONVERSION from the conversions context menu. Once a conversion has been created, it can be dropped. This section describes how to create and drop a conversion with Administrator.
The CREATE CONVERSION dialog consists of an entry box at the top for the name of the conversion. Below, is the Default checkbox. Below that are the From and To combo-boxes. These specify the source and target encoding for the conversion. Finally, there is the From Function. This is the function that will be used to carry out the actual data conversion.
In this example, you will create a simple conversion called big5_to_utf8 under the public schema. Note that a conversion for big5 to utf8 already exists under the pg_catalog schema. This example will simply create a second one in the public schema.
Start by expanding the database under which you wish to create the conversion (click the [O-] beside the database name), then expand the public schema.
Next, right click on the Conversions header and choose CREATE CONVERSION.
For the name, type: big5_to_utf8
Next is the Default checkbox; leave this unchecked as you are only creating an example and are not interested in making this the default conversion.
Next is a combo-box for selecting the source encoding (From). As you are writing a conversion from big5 to utf8, the source in this case is big5.
Set the target combo-box (To) to utf8.
For conversion function (From Function), select the function:
big5_to_utf8(pg_catalog.int4, pg_catalog.int4, pg_catalog.cstring, pg_catalog.cstring, pg_catalog.int4)
Click OK to create the conversion.
Note that the conversion big5_to_utf8 has been added under the Conversions node in the Tree View.
Administrator also enables you to perform the following operation on existing conversions:
To drop a conversion, right-click on the conversion and select either DROP RESTRICT or DROP CASCADE. DROP RESTRICT will not drop the conversion if there are any dependent objects. DROP CASCADE automatically drops the conversion and all objects that depend on it.
If Preferences => Ask For Confirmations is enabled, you are asked to confirm that you want the conversion dropped (and all the dependent objects in case of a DROP CASCADE); if it is disabled, the conversion is dropped immediately (along with its dependent objects if DROP CASCADE was selected). This action cannot be undone.