class PostgresqlTable extends MysqlTable {

    private String orderByKeysTemplate = null;

    public PostgresqlTable(String table) {
        super(table);
    }

    @Override
    protected String buildDropTemplate() {
        return String.format("DROP TABLE IF EXISTS %s CASCADE;", this.table());
    }

    @Override
    protected String buildTruncateTemplate() {
        return String.format("TRUNCATE TABLE %s CASCADE;", this.table());
    }

    @Override
    protected String engine(Session session) {
        return Strings.EMPTY;
    }

    @Override
    protected String buildUpdateForcedTemplate(MysqlBackendEntry.Row entry) {
        return this.buildInsertKeys(entry, false);
    }

    @Override
    protected List<?> buildUpdateForcedParams(MysqlBackendEntry.Row entry) {<FILL_FUNCTION_BODY>}

    @Override
    protected String buildUpdateIfAbsentTemplate(Row entry) {
        return this.buildInsertKeys(entry, true);
    }

    @Override
    protected List<?> buildUpdateIfAbsentParams(MysqlBackendEntry.Row entry) {
        return this.buildColumnsParams(entry);
    }

    protected String buildInsertKeys(MysqlBackendEntry.Row entry,
                                     boolean ignoreConflicts) {
        StringBuilder insert = new StringBuilder();
        insert.append("INSERT INTO ").append(this.table()).append(" (");

        int i = 0;
        int size = entry.columns().size();
        for (HugeKeys key : entry.columns().keySet()) {
            insert.append(formatKey(key));
            if (++i != size) {
                insert.append(", ");
            }
        }
        insert.append(") VALUES (");

        for (i = 0; i < size; i++) {
            insert.append("?");
            if (i != size - 1) {
                insert.append(", ");
            }
        }
        insert.append(")");

        i = 0;
        size = this.tableDefine().keys().size();
        insert.append(" ON CONFLICT (");
        for (HugeKeys key : this.tableDefine().keys()) {
            insert.append(formatKey(key));
            if (++i != size) {
                insert.append(", ");
            }
        }
        insert.append(")");

        if (ignoreConflicts) {
            insert.append(" DO NOTHING");
        } else {
            i = 0;
            size = entry.columns().keySet().size();
            insert.append(" DO UPDATE SET ");
            for (HugeKeys key : entry.columns().keySet()) {
                insert.append(formatKey(key)).append(" = ?");
                if (++i != size) {
                    insert.append(", ");
                }
            }
        }

        return insert.toString();
    }

    @Override
    protected String orderByKeys() {
        // Set order-by to keep results order consistence for PostgreSQL result
        if (this.orderByKeysTemplate != null) {
            return this.orderByKeysTemplate;
        }
        int i = 0;
        int size = this.tableDefine().keys().size();
        StringBuilder select = new StringBuilder(" ORDER BY ");
        for (HugeKeys hugeKey : this.tableDefine().keys()) {
            String key = formatKey(hugeKey);
            select.append(key).append(" ");
            select.append("ASC ");
            if (++i != size) {
                select.append(", ");
            }
        }
        this.orderByKeysTemplate = select.toString();
        return this.orderByKeysTemplate;
    }

    @Override
    protected WhereBuilder newWhereBuilder(boolean startWithWhere) {
        return new PgWhereBuilder(startWithWhere);
    }

    private static class PgWhereBuilder extends WhereBuilder {

        public PgWhereBuilder(boolean startWithWhere) {
            super(startWithWhere);
        }

        @Override
        protected String escapeAndWrapString(String value) {
            if (value.equals("\u0000")) {
                /* PR-2439 return string of '' */
                return "''";
            }
            return PostgresqlSessions.escapeAndWrapString(value);
        }
    }
}

        List<Object> params = new ArrayList<>();
        List<Object> allColumns = this.buildColumnsParams(entry);
        params.addAll(allColumns);
        params.addAll(allColumns);
        return params;
    
<methods>public void <init>(java.lang.String) ,public void append(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session, org.apache.hugegraph.backend.serializer.TableBackendEntry.Row) ,public void clear(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session) ,public void delete(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session, org.apache.hugegraph.backend.serializer.TableBackendEntry.Row) ,public void eliminate(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session, org.apache.hugegraph.backend.serializer.TableBackendEntry.Row) ,public static java.lang.String formatKey(org.apache.hugegraph.type.define.HugeKeys) ,public static List<java.lang.String> formatKeys(List<org.apache.hugegraph.type.define.HugeKeys>) ,public void init(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session) ,public void insert(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session, org.apache.hugegraph.backend.serializer.TableBackendEntry.Row) ,public static org.apache.hugegraph.type.define.HugeKeys parseKey(java.lang.String) ,public Iterator<org.apache.hugegraph.backend.store.BackendEntry> query(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session, org.apache.hugegraph.backend.query.Query) ,public boolean queryExist(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session, org.apache.hugegraph.backend.serializer.TableBackendEntry.Row) ,public java.lang.Number queryNumber(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session, org.apache.hugegraph.backend.query.Query) ,public abstract org.apache.hugegraph.backend.store.TableDefine tableDefine() ,public void truncate(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session) ,public void updateIfAbsent(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session, org.apache.hugegraph.backend.serializer.TableBackendEntry.Row) ,public void updateIfPresent(org.apache.hugegraph.backend.store.mysql.MysqlSessions.Session, org.apache.hugegraph.backend.serializer.TableBackendEntry.Row) <variables>private static final java.lang.String DECIMAL,private static final Logger LOG,private java.lang.String deleteTemplate,private java.lang.String insertTemplate,private java.lang.String insertTemplateTtl,private final non-sealed org.apache.hugegraph.backend.store.mysql.MysqlTable.MysqlShardSplitter shardSplitter,private java.lang.String updateIfAbsentTemplate,private java.lang.String updateIfPresentTemplate