/*******************************************************************************
 * Copyright 2017-2025 TAXTELECOM, LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package ru.taximaxim.codekeeper.ui.sqledit;

import org.pgcodekeeper.core.sql.Keyword;
import org.pgcodekeeper.core.sql.Keyword.KeywordCategory;

public class SqlPostgresSyntax {

    private static final String[] COMMENT = {
            "--" //$NON-NLS-1$
    };

    private final String[] reserved = Keyword.KEYWORDS.values().stream()
            .filter(e -> KeywordCategory.RESERVED_KEYWORD.equals(e.getCategory()))
            .map(Keyword::getKeyword)
            .toArray(String[]::new);

    private final String[] unreserved = Keyword.KEYWORDS.values().stream()
            .filter(e -> KeywordCategory.UNRESERVED_KEYWORD.equals(e.getCategory()))
            .map(Keyword::getKeyword)
            .toArray(String[]::new);

    private static final String[] TYPES = {
            "abstime", //$NON-NLS-1$
            "aclitem", //$NON-NLS-1$
            "anyarray", //$NON-NLS-1$
            "anyelement", //$NON-NLS-1$
            "anyenum", //$NON-NLS-1$
            "anynonarray", //$NON-NLS-1$
            "anyrange", //$NON-NLS-1$
            "bigint", //$NON-NLS-1$
            "bit", //$NON-NLS-1$
            "bit varying", //$NON-NLS-1$
            "boolean", //$NON-NLS-1$
            "box", //$NON-NLS-1$
            "bytea", //$NON-NLS-1$
            "char", //$NON-NLS-1$
            "character", //$NON-NLS-1$
            "character varying", //$NON-NLS-1$
            "cid", //$NON-NLS-1$
            "cidr", //$NON-NLS-1$
            "circle", //$NON-NLS-1$
            "cstring", //$NON-NLS-1$
            "date", //$NON-NLS-1$
            "daterange", //$NON-NLS-1$
            "double precision", //$NON-NLS-1$
            "event_trigger", //$NON-NLS-1$
            "fdw_handler", //$NON-NLS-1$
            "gtsvector", //$NON-NLS-1$
            "inet", //$NON-NLS-1$
            "int2vector", //$NON-NLS-1$
            "int4range", //$NON-NLS-1$
            "int8range", //$NON-NLS-1$
            "integer", //$NON-NLS-1$
            "internal", //$NON-NLS-1$
            "interval", //$NON-NLS-1$
            "json", //$NON-NLS-1$
            "language_handler", //$NON-NLS-1$
            "line", //$NON-NLS-1$
            "lseg", //$NON-NLS-1$
            "macaddr", //$NON-NLS-1$
            "money", //$NON-NLS-1$
            "numeric", //$NON-NLS-1$
            "numrange", //$NON-NLS-1$
            "oid", //$NON-NLS-1$
            "oidvector", //$NON-NLS-1$
            "opaque", //$NON-NLS-1$
            "path", //$NON-NLS-1$
            "pg_node_tree", //$NON-NLS-1$
            "point", //$NON-NLS-1$
            "polygon", //$NON-NLS-1$
            "real", //$NON-NLS-1$
            "record", //$NON-NLS-1$
            "refcursor", //$NON-NLS-1$
            "regclass", //$NON-NLS-1$
            "regconfig", //$NON-NLS-1$
            "regdictionary", //$NON-NLS-1$
            "regoper", //$NON-NLS-1$
            "regoperator", //$NON-NLS-1$
            "regproc", //$NON-NLS-1$
            "regprocedure", //$NON-NLS-1$
            "regtype", //$NON-NLS-1$
            "reltime", //$NON-NLS-1$
            "smallint", //$NON-NLS-1$
            "smgr", //$NON-NLS-1$
            "tid", //$NON-NLS-1$
            "timestamp without time zone", //$NON-NLS-1$
            "timestamp with time zone", //$NON-NLS-1$
            "time without time zone", //$NON-NLS-1$
            "time with time zone", //$NON-NLS-1$
            "tinterval", //$NON-NLS-1$
            "tsquery", //$NON-NLS-1$
            "tsrange", //$NON-NLS-1$
            "tstzrange", //$NON-NLS-1$
            "tsvector", //$NON-NLS-1$
            "txid_snapshot", //$NON-NLS-1$
            "uuid", //$NON-NLS-1$
            "void", //$NON-NLS-1$
            "xid", //$NON-NLS-1$
    };

    private static final String[] FUNCTIONS = {
            "RI_FKey_cascade_del", //$NON-NLS-1$
            "RI_FKey_cascade_upd", //$NON-NLS-1$
            "RI_FKey_check_ins", //$NON-NLS-1$
            "RI_FKey_check_upd", //$NON-NLS-1$
            "RI_FKey_noaction_del", //$NON-NLS-1$
            "RI_FKey_noaction_upd", //$NON-NLS-1$
            "RI_FKey_restrict_del", //$NON-NLS-1$
            "RI_FKey_restrict_upd", //$NON-NLS-1$
            "RI_FKey_setdefault_del", //$NON-NLS-1$
            "RI_FKey_setdefault_upd", //$NON-NLS-1$
            "RI_FKey_setnull_del", //$NON-NLS-1$
            "RI_FKey_setnull_upd", //$NON-NLS-1$
            "_pg_char_max_length", //$NON-NLS-1$
            "_pg_char_octet_length", //$NON-NLS-1$
            "_pg_datetime_precision", //$NON-NLS-1$
            "_pg_expandarray", //$NON-NLS-1$
            "_pg_index_position", //$NON-NLS-1$
            "_pg_interval_type", //$NON-NLS-1$
            "_pg_keysequal", //$NON-NLS-1$
            "_pg_numeric_precision", //$NON-NLS-1$
            "_pg_numeric_precision_radix", //$NON-NLS-1$
            "_pg_numeric_scale", //$NON-NLS-1$
            "_pg_truetypid", //$NON-NLS-1$
            "_pg_truetypmod", //$NON-NLS-1$
            "abbrev", //$NON-NLS-1$
            "abs", //$NON-NLS-1$
            "abstimeeq", //$NON-NLS-1$
            "abstimege", //$NON-NLS-1$
            "abstimegt", //$NON-NLS-1$
            "abstimein", //$NON-NLS-1$
            "abstimele", //$NON-NLS-1$
            "abstimelt", //$NON-NLS-1$
            "abstimene", //$NON-NLS-1$
            "abstimeout", //$NON-NLS-1$
            "abstimerecv", //$NON-NLS-1$
            "abstimesend", //$NON-NLS-1$
            "aclcontains", //$NON-NLS-1$
            "acldefault", //$NON-NLS-1$
            "aclexplode", //$NON-NLS-1$
            "aclinsert", //$NON-NLS-1$
            "aclitemeq", //$NON-NLS-1$
            "aclitemin", //$NON-NLS-1$
            "aclitemout", //$NON-NLS-1$
            "aclremove", //$NON-NLS-1$
            "acos", //$NON-NLS-1$
            "age", //$NON-NLS-1$
            "any_in", //$NON-NLS-1$
            "any_out", //$NON-NLS-1$
            "anyarray_in", //$NON-NLS-1$
            "anyarray_out", //$NON-NLS-1$
            "anyarray_recv", //$NON-NLS-1$
            "anyarray_send", //$NON-NLS-1$
            "anyelement_in", //$NON-NLS-1$
            "anyelement_out", //$NON-NLS-1$
            "anyenum_in", //$NON-NLS-1$
            "anyenum_out", //$NON-NLS-1$
            "anynonarray_in", //$NON-NLS-1$
            "anynonarray_out", //$NON-NLS-1$
            "anyrange_in", //$NON-NLS-1$
            "anyrange_out", //$NON-NLS-1$
            "anytextcat", //$NON-NLS-1$
            "area", //$NON-NLS-1$
            "areajoinsel", //$NON-NLS-1$
            "areasel", //$NON-NLS-1$
            "array_agg", //$NON-NLS-1$
            "array_agg_finalfn", //$NON-NLS-1$
            "array_agg_transfn", //$NON-NLS-1$
            "array_append", //$NON-NLS-1$
            "array_cat", //$NON-NLS-1$
            "array_dims", //$NON-NLS-1$
            "array_eq", //$NON-NLS-1$
            "array_fill", //$NON-NLS-1$
            "array_ge", //$NON-NLS-1$
            "array_gt", //$NON-NLS-1$
            "array_in", //$NON-NLS-1$
            "array_larger", //$NON-NLS-1$
            "array_le", //$NON-NLS-1$
            "array_length", //$NON-NLS-1$
            "array_lower", //$NON-NLS-1$
            "array_lt", //$NON-NLS-1$
            "array_ndims", //$NON-NLS-1$
            "array_ne", //$NON-NLS-1$
            "array_out", //$NON-NLS-1$
            "array_prepend", //$NON-NLS-1$
            "array_recv", //$NON-NLS-1$
            "array_remove", //$NON-NLS-1$
            "array_replace", //$NON-NLS-1$
            "array_send", //$NON-NLS-1$
            "array_smaller", //$NON-NLS-1$
            "array_to_json", //$NON-NLS-1$
            "array_to_string", //$NON-NLS-1$
            "array_typanalyze", //$NON-NLS-1$
            "array_upper", //$NON-NLS-1$
            "arraycontained", //$NON-NLS-1$
            "arraycontains", //$NON-NLS-1$
            "arraycontjoinsel", //$NON-NLS-1$
            "arraycontsel", //$NON-NLS-1$
            "arrayoverlap", //$NON-NLS-1$
            "ascii", //$NON-NLS-1$
            "ascii_to_mic", //$NON-NLS-1$
            "ascii_to_utf8", //$NON-NLS-1$
            "asin", //$NON-NLS-1$
            "atan", //$NON-NLS-1$
            "atan2", //$NON-NLS-1$
            "avg", //$NON-NLS-1$
            "big5_to_euc_tw", //$NON-NLS-1$
            "big5_to_mic", //$NON-NLS-1$
            "big5_to_utf8", //$NON-NLS-1$
            "bit_and", //$NON-NLS-1$
            "bit_in", //$NON-NLS-1$
            "bit_length", //$NON-NLS-1$
            "bit_or", //$NON-NLS-1$
            "bit_out", //$NON-NLS-1$
            "bit_recv", //$NON-NLS-1$
            "bit_send", //$NON-NLS-1$
            "bitand", //$NON-NLS-1$
            "bitcat", //$NON-NLS-1$
            "bitcmp", //$NON-NLS-1$
            "biteq", //$NON-NLS-1$
            "bitge", //$NON-NLS-1$
            "bitgt", //$NON-NLS-1$
            "bitle", //$NON-NLS-1$
            "bitlt", //$NON-NLS-1$
            "bitne", //$NON-NLS-1$
            "bitnot", //$NON-NLS-1$
            "bitor", //$NON-NLS-1$
            "bitshiftleft", //$NON-NLS-1$
            "bitshiftright", //$NON-NLS-1$
            "bittypmodin", //$NON-NLS-1$
            "bittypmodout", //$NON-NLS-1$
            "bitxor", //$NON-NLS-1$
            "bool", //$NON-NLS-1$
            "bool_and", //$NON-NLS-1$
            "bool_or", //$NON-NLS-1$
            "booland_statefunc", //$NON-NLS-1$
            "booleq", //$NON-NLS-1$
            "boolge", //$NON-NLS-1$
            "boolgt", //$NON-NLS-1$
            "boolin", //$NON-NLS-1$
            "boolle", //$NON-NLS-1$
            "boollt", //$NON-NLS-1$
            "boolne", //$NON-NLS-1$
            "boolor_statefunc", //$NON-NLS-1$
            "boolout", //$NON-NLS-1$
            "boolrecv", //$NON-NLS-1$
            "boolsend", //$NON-NLS-1$
            "box_above", //$NON-NLS-1$
            "box_above_eq", //$NON-NLS-1$
            "box_add", //$NON-NLS-1$
            "box_below", //$NON-NLS-1$
            "box_below_eq", //$NON-NLS-1$
            "box_center", //$NON-NLS-1$
            "box_contain", //$NON-NLS-1$
            "box_contain_pt", //$NON-NLS-1$
            "box_contained", //$NON-NLS-1$
            "box_distance", //$NON-NLS-1$
            "box_div", //$NON-NLS-1$
            "box_eq", //$NON-NLS-1$
            "box_ge", //$NON-NLS-1$
            "box_gt", //$NON-NLS-1$
            "box_in", //$NON-NLS-1$
            "box_intersect", //$NON-NLS-1$
            "box_le", //$NON-NLS-1$
            "box_left", //$NON-NLS-1$
            "box_lt", //$NON-NLS-1$
            "box_mul", //$NON-NLS-1$
            "box_out", //$NON-NLS-1$
            "box_overabove", //$NON-NLS-1$
            "box_overbelow", //$NON-NLS-1$
            "box_overlap", //$NON-NLS-1$
            "box_overleft", //$NON-NLS-1$
            "box_overright", //$NON-NLS-1$
            "box_recv", //$NON-NLS-1$
            "box_right", //$NON-NLS-1$
            "box_same", //$NON-NLS-1$
            "box_send", //$NON-NLS-1$
            "box_sub", //$NON-NLS-1$
            "bpchar", //$NON-NLS-1$
            "bpchar_larger", //$NON-NLS-1$
            "bpchar_pattern_ge", //$NON-NLS-1$
            "bpchar_pattern_gt", //$NON-NLS-1$
            "bpchar_pattern_le", //$NON-NLS-1$
            "bpchar_pattern_lt", //$NON-NLS-1$
            "bpchar_smaller", //$NON-NLS-1$
            "bpcharcmp", //$NON-NLS-1$
            "bpchareq", //$NON-NLS-1$
            "bpcharge", //$NON-NLS-1$
            "bpchargt", //$NON-NLS-1$
            "bpchariclike", //$NON-NLS-1$
            "bpcharicnlike", //$NON-NLS-1$
            "bpcharicregexeq", //$NON-NLS-1$
            "bpcharicregexne", //$NON-NLS-1$
            "bpcharin", //$NON-NLS-1$
            "bpcharle", //$NON-NLS-1$
            "bpcharlike", //$NON-NLS-1$
            "bpcharlt", //$NON-NLS-1$
            "bpcharne", //$NON-NLS-1$
            "bpcharnlike", //$NON-NLS-1$
            "bpcharout", //$NON-NLS-1$
            "bpcharrecv", //$NON-NLS-1$
            "bpcharregexeq", //$NON-NLS-1$
            "bpcharregexne", //$NON-NLS-1$
            "bpcharsend", //$NON-NLS-1$
            "bpchartypmodin", //$NON-NLS-1$
            "bpchartypmodout", //$NON-NLS-1$
            "broadcast", //$NON-NLS-1$
            "btabstimecmp", //$NON-NLS-1$
            "btarraycmp", //$NON-NLS-1$
            "btbeginscan", //$NON-NLS-1$
            "btboolcmp", //$NON-NLS-1$
            "btbpchar_pattern_cmp", //$NON-NLS-1$
            "btbuild", //$NON-NLS-1$
            "btbuildempty", //$NON-NLS-1$
            "btbulkdelete", //$NON-NLS-1$
            "btcanreturn", //$NON-NLS-1$
            "btcharcmp", //$NON-NLS-1$
            "btcostestimate", //$NON-NLS-1$
            "btendscan", //$NON-NLS-1$
            "btfloat48cmp", //$NON-NLS-1$
            "btfloat4cmp", //$NON-NLS-1$
            "btfloat4sortsupport", //$NON-NLS-1$
            "btfloat84cmp", //$NON-NLS-1$
            "btfloat8cmp", //$NON-NLS-1$
            "btfloat8sortsupport", //$NON-NLS-1$
            "btgetbitmap", //$NON-NLS-1$
            "btgettuple", //$NON-NLS-1$
            "btinsert", //$NON-NLS-1$
            "btint24cmp", //$NON-NLS-1$
            "btint28cmp", //$NON-NLS-1$
            "btint2cmp", //$NON-NLS-1$
            "btint2sortsupport", //$NON-NLS-1$
            "btint42cmp", //$NON-NLS-1$
            "btint48cmp", //$NON-NLS-1$
            "btint4cmp", //$NON-NLS-1$
            "btint4sortsupport", //$NON-NLS-1$
            "btint82cmp", //$NON-NLS-1$
            "btint84cmp", //$NON-NLS-1$
            "btint8cmp", //$NON-NLS-1$
            "btint8sortsupport", //$NON-NLS-1$
            "btmarkpos", //$NON-NLS-1$
            "btnamecmp", //$NON-NLS-1$
            "btnamesortsupport", //$NON-NLS-1$
            "btoidcmp", //$NON-NLS-1$
            "btoidsortsupport", //$NON-NLS-1$
            "btoidvectorcmp", //$NON-NLS-1$
            "btoptions", //$NON-NLS-1$
            "btrecordcmp", //$NON-NLS-1$
            "btreltimecmp", //$NON-NLS-1$
            "btrescan", //$NON-NLS-1$
            "btrestrpos", //$NON-NLS-1$
            "btrim", //$NON-NLS-1$
            "bttext_pattern_cmp", //$NON-NLS-1$
            "bttextcmp", //$NON-NLS-1$
            "bttidcmp", //$NON-NLS-1$
            "bttintervalcmp", //$NON-NLS-1$
            "btvacuumcleanup", //$NON-NLS-1$
            "bytea_string_agg_finalfn", //$NON-NLS-1$
            "bytea_string_agg_transfn", //$NON-NLS-1$
            "byteacat", //$NON-NLS-1$
            "byteacmp", //$NON-NLS-1$
            "byteaeq", //$NON-NLS-1$
            "byteage", //$NON-NLS-1$
            "byteagt", //$NON-NLS-1$
            "byteain", //$NON-NLS-1$
            "byteale", //$NON-NLS-1$
            "bytealike", //$NON-NLS-1$
            "bytealt", //$NON-NLS-1$
            "byteane", //$NON-NLS-1$
            "byteanlike", //$NON-NLS-1$
            "byteaout", //$NON-NLS-1$
            "bytearecv", //$NON-NLS-1$
            "byteasend", //$NON-NLS-1$
            "cash_cmp", //$NON-NLS-1$
            "cash_div_cash", //$NON-NLS-1$
            "cash_div_flt4", //$NON-NLS-1$
            "cash_div_flt8", //$NON-NLS-1$
            "cash_div_int2", //$NON-NLS-1$
            "cash_div_int4", //$NON-NLS-1$
            "cash_eq", //$NON-NLS-1$
            "cash_ge", //$NON-NLS-1$
            "cash_gt", //$NON-NLS-1$
            "cash_in", //$NON-NLS-1$
            "cash_le", //$NON-NLS-1$
            "cash_lt", //$NON-NLS-1$
            "cash_mi", //$NON-NLS-1$
            "cash_mul_flt4", //$NON-NLS-1$
            "cash_mul_flt8", //$NON-NLS-1$
            "cash_mul_int2", //$NON-NLS-1$
            "cash_mul_int4", //$NON-NLS-1$
            "cash_ne", //$NON-NLS-1$
            "cash_out", //$NON-NLS-1$
            "cash_pl", //$NON-NLS-1$
            "cash_recv", //$NON-NLS-1$
            "cash_send", //$NON-NLS-1$
            "cash_words", //$NON-NLS-1$
            "cashlarger", //$NON-NLS-1$
            "cashsmaller", //$NON-NLS-1$
            "cbrt", //$NON-NLS-1$
            "ceil", //$NON-NLS-1$
            "ceiling", //$NON-NLS-1$
            "center", //$NON-NLS-1$
            "char_length", //$NON-NLS-1$
            "character_length", //$NON-NLS-1$
            "chareq", //$NON-NLS-1$
            "charge", //$NON-NLS-1$
            "chargt", //$NON-NLS-1$
            "charin", //$NON-NLS-1$
            "charle", //$NON-NLS-1$
            "charlt", //$NON-NLS-1$
            "charne", //$NON-NLS-1$
            "charout", //$NON-NLS-1$
            "charrecv", //$NON-NLS-1$
            "charsend", //$NON-NLS-1$
            "chr", //$NON-NLS-1$
            "cideq", //$NON-NLS-1$
            "cidin", //$NON-NLS-1$
            "cidout", //$NON-NLS-1$
            "cidr_in", //$NON-NLS-1$
            "cidr_out", //$NON-NLS-1$
            "cidr_recv", //$NON-NLS-1$
            "cidr_send", //$NON-NLS-1$
            "cidrecv", //$NON-NLS-1$
            "cidsend", //$NON-NLS-1$
            "circle_above", //$NON-NLS-1$
            "circle_add_pt", //$NON-NLS-1$
            "circle_below", //$NON-NLS-1$
            "circle_center", //$NON-NLS-1$
            "circle_contain", //$NON-NLS-1$
            "circle_contain_pt", //$NON-NLS-1$
            "circle_contained", //$NON-NLS-1$
            "circle_distance", //$NON-NLS-1$
            "circle_div_pt", //$NON-NLS-1$
            "circle_eq", //$NON-NLS-1$
            "circle_ge", //$NON-NLS-1$
            "circle_gt", //$NON-NLS-1$
            "circle_in", //$NON-NLS-1$
            "circle_le", //$NON-NLS-1$
            "circle_left", //$NON-NLS-1$
            "circle_lt", //$NON-NLS-1$
            "circle_mul_pt", //$NON-NLS-1$
            "circle_ne", //$NON-NLS-1$
            "circle_out", //$NON-NLS-1$
            "circle_overabove", //$NON-NLS-1$
            "circle_overbelow", //$NON-NLS-1$
            "circle_overlap", //$NON-NLS-1$
            "circle_overleft", //$NON-NLS-1$
            "circle_overright", //$NON-NLS-1$
            "circle_recv", //$NON-NLS-1$
            "circle_right", //$NON-NLS-1$
            "circle_same", //$NON-NLS-1$
            "circle_send", //$NON-NLS-1$
            "circle_sub_pt", //$NON-NLS-1$
            "clock_timestamp", //$NON-NLS-1$
            "close_lb", //$NON-NLS-1$
            "close_ls", //$NON-NLS-1$
            "close_lseg", //$NON-NLS-1$
            "close_pb", //$NON-NLS-1$
            "close_pl", //$NON-NLS-1$
            "close_ps", //$NON-NLS-1$
            "close_sb", //$NON-NLS-1$
            "close_sl", //$NON-NLS-1$
            "col_description", //$NON-NLS-1$
            "concat", //$NON-NLS-1$
            "concat_ws", //$NON-NLS-1$
            "contjoinsel", //$NON-NLS-1$
            "contsel", //$NON-NLS-1$
            "convert", //$NON-NLS-1$
            "convert_from", //$NON-NLS-1$
            "convert_to", //$NON-NLS-1$
            "corr", //$NON-NLS-1$
            "cos", //$NON-NLS-1$
            "cot", //$NON-NLS-1$
            "count", //$NON-NLS-1$
            "covar_pop", //$NON-NLS-1$
            "covar_samp", //$NON-NLS-1$
            "cstring_in", //$NON-NLS-1$
            "cstring_out", //$NON-NLS-1$
            "cstring_recv", //$NON-NLS-1$
            "cstring_send", //$NON-NLS-1$
            "cume_dist", //$NON-NLS-1$
            "current_database", //$NON-NLS-1$
            "current_query", //$NON-NLS-1$
            "current_schema", //$NON-NLS-1$
            "current_schemas", //$NON-NLS-1$
            "current_setting", //$NON-NLS-1$
            "currtid", //$NON-NLS-1$
            "currtid2", //$NON-NLS-1$
            "currval", //$NON-NLS-1$
            "cursor_to_xml", //$NON-NLS-1$
            "cursor_to_xmlschema", //$NON-NLS-1$
            "database_to_xml", //$NON-NLS-1$
            "database_to_xml_and_xmlschema", //$NON-NLS-1$
            "database_to_xmlschema", //$NON-NLS-1$
            "date_cmp", //$NON-NLS-1$
            "date_cmp_timestamp", //$NON-NLS-1$
            "date_cmp_timestamptz", //$NON-NLS-1$
            "date_eq", //$NON-NLS-1$
            "date_eq_timestamp", //$NON-NLS-1$
            "date_eq_timestamptz", //$NON-NLS-1$
            "date_ge", //$NON-NLS-1$
            "date_ge_timestamp", //$NON-NLS-1$
            "date_ge_timestamptz", //$NON-NLS-1$
            "date_gt", //$NON-NLS-1$
            "date_gt_timestamp", //$NON-NLS-1$
            "date_gt_timestamptz", //$NON-NLS-1$
            "date_in", //$NON-NLS-1$
            "date_larger", //$NON-NLS-1$
            "date_le", //$NON-NLS-1$
            "date_le_timestamp", //$NON-NLS-1$
            "date_le_timestamptz", //$NON-NLS-1$
            "date_lt", //$NON-NLS-1$
            "date_lt_timestamp", //$NON-NLS-1$
            "date_lt_timestamptz", //$NON-NLS-1$
            "date_mi", //$NON-NLS-1$
            "date_mi_interval", //$NON-NLS-1$
            "date_mii", //$NON-NLS-1$
            "date_ne", //$NON-NLS-1$
            "date_ne_timestamp", //$NON-NLS-1$
            "date_ne_timestamptz", //$NON-NLS-1$
            "date_out", //$NON-NLS-1$
            "date_part", //$NON-NLS-1$
            "date_pl_interval", //$NON-NLS-1$
            "date_pli", //$NON-NLS-1$
            "date_recv", //$NON-NLS-1$
            "date_send", //$NON-NLS-1$
            "date_smaller", //$NON-NLS-1$
            "date_sortsupport", //$NON-NLS-1$
            "date_trunc", //$NON-NLS-1$
            "daterange_canonical", //$NON-NLS-1$
            "daterange_subdiff", //$NON-NLS-1$
            "datetime_pl", //$NON-NLS-1$
            "datetimetz_pl", //$NON-NLS-1$
            "dcbrt", //$NON-NLS-1$
            "decode", //$NON-NLS-1$
            "degrees", //$NON-NLS-1$
            "dense_rank", //$NON-NLS-1$
            "dexp", //$NON-NLS-1$
            "diagonal", //$NON-NLS-1$
            "diameter", //$NON-NLS-1$
            "dispell_init", //$NON-NLS-1$
            "dispell_lexize", //$NON-NLS-1$
            "dist_cpoly", //$NON-NLS-1$
            "dist_lb", //$NON-NLS-1$
            "dist_pb", //$NON-NLS-1$
            "dist_pc", //$NON-NLS-1$
            "dist_pl", //$NON-NLS-1$
            "dist_ppath", //$NON-NLS-1$
            "dist_ps", //$NON-NLS-1$
            "dist_sb", //$NON-NLS-1$
            "dist_sl", //$NON-NLS-1$
            "div", //$NON-NLS-1$
            "dlog1", //$NON-NLS-1$
            "dlog10", //$NON-NLS-1$
            "domain_in", //$NON-NLS-1$
            "domain_recv", //$NON-NLS-1$
            "dpow", //$NON-NLS-1$
            "dround", //$NON-NLS-1$
            "dsimple_init", //$NON-NLS-1$
            "dsimple_lexize", //$NON-NLS-1$
            "dsnowball_init", //$NON-NLS-1$
            "dsnowball_lexize", //$NON-NLS-1$
            "dsqrt", //$NON-NLS-1$
            "dsynonym_init", //$NON-NLS-1$
            "dsynonym_lexize", //$NON-NLS-1$
            "dtrunc", //$NON-NLS-1$
            "elem_contained_by_range", //$NON-NLS-1$
            "encode", //$NON-NLS-1$
            "enum_cmp", //$NON-NLS-1$
            "enum_eq", //$NON-NLS-1$
            "enum_first", //$NON-NLS-1$
            "enum_ge", //$NON-NLS-1$
            "enum_gt", //$NON-NLS-1$
            "enum_in", //$NON-NLS-1$
            "enum_larger", //$NON-NLS-1$
            "enum_last", //$NON-NLS-1$
            "enum_le", //$NON-NLS-1$
            "enum_lt", //$NON-NLS-1$
            "enum_ne", //$NON-NLS-1$
            "enum_out", //$NON-NLS-1$
            "enum_range", //$NON-NLS-1$
            "enum_recv", //$NON-NLS-1$
            "enum_send", //$NON-NLS-1$
            "enum_smaller", //$NON-NLS-1$
            "eqjoinsel", //$NON-NLS-1$
            "eqsel", //$NON-NLS-1$
            "euc_cn_to_mic", //$NON-NLS-1$
            "euc_cn_to_utf8", //$NON-NLS-1$
            "euc_jis_2004_to_shift_jis_2004", //$NON-NLS-1$
            "euc_jis_2004_to_utf8", //$NON-NLS-1$
            "euc_jp_to_mic", //$NON-NLS-1$
            "euc_jp_to_sjis", //$NON-NLS-1$
            "euc_jp_to_utf8", //$NON-NLS-1$
            "euc_kr_to_mic", //$NON-NLS-1$
            "euc_kr_to_utf8", //$NON-NLS-1$
            "euc_tw_to_big5", //$NON-NLS-1$
            "euc_tw_to_mic", //$NON-NLS-1$
            "euc_tw_to_utf8", //$NON-NLS-1$
            "event_trigger_in", //$NON-NLS-1$
            "event_trigger_out", //$NON-NLS-1$
            "every", //$NON-NLS-1$
            "exp", //$NON-NLS-1$
            "factorial", //$NON-NLS-1$
            "fdw_handler_in", //$NON-NLS-1$
            "fdw_handler_out", //$NON-NLS-1$
            "first_value", //$NON-NLS-1$
            "float4", //$NON-NLS-1$
            "float48div", //$NON-NLS-1$
            "float48eq", //$NON-NLS-1$
            "float48ge", //$NON-NLS-1$
            "float48gt", //$NON-NLS-1$
            "float48le", //$NON-NLS-1$
            "float48lt", //$NON-NLS-1$
            "float48mi", //$NON-NLS-1$
            "float48mul", //$NON-NLS-1$
            "float48ne", //$NON-NLS-1$
            "float48pl", //$NON-NLS-1$
            "float4_accum", //$NON-NLS-1$
            "float4abs", //$NON-NLS-1$
            "float4div", //$NON-NLS-1$
            "float4eq", //$NON-NLS-1$
            "float4ge", //$NON-NLS-1$
            "float4gt", //$NON-NLS-1$
            "float4in", //$NON-NLS-1$
            "float4larger", //$NON-NLS-1$
            "float4le", //$NON-NLS-1$
            "float4lt", //$NON-NLS-1$
            "float4mi", //$NON-NLS-1$
            "float4mul", //$NON-NLS-1$
            "float4ne", //$NON-NLS-1$
            "float4out", //$NON-NLS-1$
            "float4pl", //$NON-NLS-1$
            "float4recv", //$NON-NLS-1$
            "float4send", //$NON-NLS-1$
            "float4smaller", //$NON-NLS-1$
            "float4um", //$NON-NLS-1$
            "float4up", //$NON-NLS-1$
            "float8", //$NON-NLS-1$
            "float84div", //$NON-NLS-1$
            "float84eq", //$NON-NLS-1$
            "float84ge", //$NON-NLS-1$
            "float84gt", //$NON-NLS-1$
            "float84le", //$NON-NLS-1$
            "float84lt", //$NON-NLS-1$
            "float84mi", //$NON-NLS-1$
            "float84mul", //$NON-NLS-1$
            "float84ne", //$NON-NLS-1$
            "float84pl", //$NON-NLS-1$
            "float8_accum", //$NON-NLS-1$
            "float8_avg", //$NON-NLS-1$
            "float8_corr", //$NON-NLS-1$
            "float8_covar_pop", //$NON-NLS-1$
            "float8_covar_samp", //$NON-NLS-1$
            "float8_regr_accum", //$NON-NLS-1$
            "float8_regr_avgx", //$NON-NLS-1$
            "float8_regr_avgy", //$NON-NLS-1$
            "float8_regr_intercept", //$NON-NLS-1$
            "float8_regr_r2", //$NON-NLS-1$
            "float8_regr_slope", //$NON-NLS-1$
            "float8_regr_sxx", //$NON-NLS-1$
            "float8_regr_sxy", //$NON-NLS-1$
            "float8_regr_syy", //$NON-NLS-1$
            "float8_stddev_pop", //$NON-NLS-1$
            "float8_stddev_samp", //$NON-NLS-1$
            "float8_var_pop", //$NON-NLS-1$
            "float8_var_samp", //$NON-NLS-1$
            "float8abs", //$NON-NLS-1$
            "float8div", //$NON-NLS-1$
            "float8eq", //$NON-NLS-1$
            "float8ge", //$NON-NLS-1$
            "float8gt", //$NON-NLS-1$
            "float8in", //$NON-NLS-1$
            "float8larger", //$NON-NLS-1$
            "float8le", //$NON-NLS-1$
            "float8lt", //$NON-NLS-1$
            "float8mi", //$NON-NLS-1$
            "float8mul", //$NON-NLS-1$
            "float8ne", //$NON-NLS-1$
            "float8out", //$NON-NLS-1$
            "float8pl", //$NON-NLS-1$
            "float8recv", //$NON-NLS-1$
            "float8send", //$NON-NLS-1$
            "float8smaller", //$NON-NLS-1$
            "float8um", //$NON-NLS-1$
            "float8up", //$NON-NLS-1$
            "floor", //$NON-NLS-1$
            "flt4_mul_cash", //$NON-NLS-1$
            "flt8_mul_cash", //$NON-NLS-1$
            "fmgr_c_validator", //$NON-NLS-1$
            "fmgr_internal_validator", //$NON-NLS-1$
            "fmgr_sql_validator", //$NON-NLS-1$
            "format", //$NON-NLS-1$
            "format_type", //$NON-NLS-1$
            "gb18030_to_utf8", //$NON-NLS-1$
            "gbk_to_utf8", //$NON-NLS-1$
            "generate_series", //$NON-NLS-1$
            "generate_subscripts", //$NON-NLS-1$
            "get_bit", //$NON-NLS-1$
            "get_byte", //$NON-NLS-1$
            "get_current_ts_config", //$NON-NLS-1$
            "getdatabaseencoding", //$NON-NLS-1$
            "getpgusername", //$NON-NLS-1$
            "gin_cmp_prefix", //$NON-NLS-1$
            "gin_cmp_tslexeme", //$NON-NLS-1$
            "gin_extract_tsquery", //$NON-NLS-1$
            "gin_extract_tsvector", //$NON-NLS-1$
            "gin_tsquery_consistent", //$NON-NLS-1$
            "ginarrayconsistent", //$NON-NLS-1$
            "ginarrayextract", //$NON-NLS-1$
            "ginbeginscan", //$NON-NLS-1$
            "ginbuild", //$NON-NLS-1$
            "ginbuildempty", //$NON-NLS-1$
            "ginbulkdelete", //$NON-NLS-1$
            "gincostestimate", //$NON-NLS-1$
            "ginendscan", //$NON-NLS-1$
            "gingetbitmap", //$NON-NLS-1$
            "gininsert", //$NON-NLS-1$
            "ginmarkpos", //$NON-NLS-1$
            "ginoptions", //$NON-NLS-1$
            "ginqueryarrayextract", //$NON-NLS-1$
            "ginrescan", //$NON-NLS-1$
            "ginrestrpos", //$NON-NLS-1$
            "ginvacuumcleanup", //$NON-NLS-1$
            "gist_box_compress", //$NON-NLS-1$
            "gist_box_consistent", //$NON-NLS-1$
            "gist_box_decompress", //$NON-NLS-1$
            "gist_box_penalty", //$NON-NLS-1$
            "gist_box_picksplit", //$NON-NLS-1$
            "gist_box_same", //$NON-NLS-1$
            "gist_box_union", //$NON-NLS-1$
            "gist_circle_compress", //$NON-NLS-1$
            "gist_circle_consistent", //$NON-NLS-1$
            "gist_point_compress", //$NON-NLS-1$
            "gist_point_consistent", //$NON-NLS-1$
            "gist_point_distance", //$NON-NLS-1$
            "gist_poly_compress", //$NON-NLS-1$
            "gist_poly_consistent", //$NON-NLS-1$
            "gistbeginscan", //$NON-NLS-1$
            "gistbuild", //$NON-NLS-1$
            "gistbuildempty", //$NON-NLS-1$
            "gistbulkdelete", //$NON-NLS-1$
            "gistcostestimate", //$NON-NLS-1$
            "gistendscan", //$NON-NLS-1$
            "gistgetbitmap", //$NON-NLS-1$
            "gistgettuple", //$NON-NLS-1$
            "gistinsert", //$NON-NLS-1$
            "gistmarkpos", //$NON-NLS-1$
            "gistoptions", //$NON-NLS-1$
            "gistrescan", //$NON-NLS-1$
            "gistrestrpos", //$NON-NLS-1$
            "gistvacuumcleanup", //$NON-NLS-1$
            "gtsquery_compress", //$NON-NLS-1$
            "gtsquery_consistent", //$NON-NLS-1$
            "gtsquery_decompress", //$NON-NLS-1$
            "gtsquery_penalty", //$NON-NLS-1$
            "gtsquery_picksplit", //$NON-NLS-1$
            "gtsquery_same", //$NON-NLS-1$
            "gtsquery_union", //$NON-NLS-1$
            "gtsvector_compress", //$NON-NLS-1$
            "gtsvector_consistent", //$NON-NLS-1$
            "gtsvector_decompress", //$NON-NLS-1$
            "gtsvector_penalty", //$NON-NLS-1$
            "gtsvector_picksplit", //$NON-NLS-1$
            "gtsvector_same", //$NON-NLS-1$
            "gtsvector_union", //$NON-NLS-1$
            "gtsvectorin", //$NON-NLS-1$
            "gtsvectorout", //$NON-NLS-1$
            "has_any_column_privilege", //$NON-NLS-1$
            "has_column_privilege", //$NON-NLS-1$
            "has_database_privilege", //$NON-NLS-1$
            "has_foreign_data_wrapper_privilege", //$NON-NLS-1$
            "has_function_privilege", //$NON-NLS-1$
            "has_language_privilege", //$NON-NLS-1$
            "has_schema_privilege", //$NON-NLS-1$
            "has_sequence_privilege", //$NON-NLS-1$
            "has_server_privilege", //$NON-NLS-1$
            "has_table_privilege", //$NON-NLS-1$
            "has_tablespace_privilege", //$NON-NLS-1$
            "has_type_privilege", //$NON-NLS-1$
            "hash_aclitem", //$NON-NLS-1$
            "hash_array", //$NON-NLS-1$
            "hash_numeric", //$NON-NLS-1$
            "hash_range", //$NON-NLS-1$
            "hashbeginscan", //$NON-NLS-1$
