Wrap a column and cast in pgsql.

@param  string $column
@return string
507247
public function castColumn($column)
    {
        $column = $this->connection->getQueryGrammar()->wrap($column);
        if ($this->database === 'pgsql') {
            $column = 'CAST(' . $column . ' as TEXT)';
        } elseif ($this->database === 'firebird') {
            $column = 'CAST(' . $column . ' as VARCHAR(255))';
        }

        return $column;
    }
412142
public function getColumnType($table, $column)
    {
        $table = $this->connection->getTablePrefix().$table;

        return $this->connection->getDoctrineColumn($table, $column)->getType()->getName();
    }
882325
public function columnSql($column, $platform)
    {
        return $platform->columnSql($column, "set('" . implode("','", $this->_set) . "')", $this->options());
    }
128292
public function orWhereIs(string $column)
    {
        $instance = $this->whereStrategyInstance();

        $instance->whereStrategy()->orWhereIs($column);

        return $instance;
    }
172112
public function orHavingIsNull(string $column)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->orHavingIsNull($column);

        return $instance;
    }
407775
protected function getFieldByColumn($column)
    {
        return $this->builder->fields()->first(
            function (Field $field) use ($column) {
                if (is_array($field->column())) {
                    return in_array($column, $field->column(), true);
                }

                return $field->column() === $column;
            }
        );
    }
748395
public function column($column = '*')
    {
        if ('*' == $column) {
            $this->columns = ['*'];
        } else {
            $columns = $this->prepareNames(func_get_args());
            $this->columns = array_merge(
                empty($this->columns) || ['*'] == $this->columns ? [] : $this->columns,
                array_values(array_diff($columns, ['*']))
            );
        }
        return $this;
    }
10280
protected function parseColumn($column) {
		if ($column instanceof Column) {
			$type = $column->getType();
			return empty($type) ? $column->getName() : $column->getName() . ':' . $type;
		}
		
		return $column;
	}
175436
public function orHavingIsNotNull(string $column)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->orHavingIsNotNull($column);

        return $instance;
    }
837466
public function havingIsNull(string $column)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->havingIsNull($column);

        return $instance;
    }
589531
public static function insert($column)
    {
        try {

            self::instance();

            $tableStatic = static::$table;

            foreach ($column as $key => $value) {
                $col[]    = "$key";
                $values[] = ":$key";
            }

            $columns = implode(', ', $col);
            
            $values  = implode(', ', $values);
            
            $stmt    = self::$db->prepare("insert into {$tableStatic} ({$columns}) values ({$values})");

            foreach ($column as $key => $value) {
                $stmt->bindValue(":$key", $value);
            }

            $stmt->execute();

            if ($stmt->rowCount() == 1) {
                return true;
            }

        } catch (PDOException $e) {

            $error = new Error();
            $error->errorMessage("Error: não foi possível inserir o dado. Verifique se os dados corretos. ".$e->getMessage());

        }
    }
267590
private function formatColumn($column)
    {
        $column = trim($column);
        /*调用系统函数时不处理*/
        if (strpos($column, '(') !== false) {
            return $column;
        }
        if (strpos($column, '.') !== false) {
            list($table, $column) = explode('.', $column);
            $table = '`' . $table . '`.';
        } else {
            $table = '';
        }
        if ($column == '*') {
            return $table . $column;
        }
        if (strpos($column, ' ') === false) {
            return $table . '`' . $column . '`';
        }
        $column = preg_replace('/[ ]+/', ' ', $column);
        $columns = explode(' ', $column);
        if (count($columns) == 3) {
            list($column, $as, $alias) = $columns;
        } else {
            list($column, $alias) = $columns;
        }
        return $table . '`' . $column . '` as `' . $alias . '`';
    }
557000
protected function usingTextToNumeric($column, $type)
    {
        $type = strtolower($type);

        $details = $this->getColumnDetail($column);

        list($originType) = explode('(', $details->Type);

        $textTypes = [
            PostgresqlType::TEXT,
            PostgresqlType::CHAR,
            PostgresqlType::CHARACTER,
            PostgresqlType::VARCHAR,
        ];

        $numericTypes = [
            PostgresqlType::INTEGER,
            PostgresqlType::SMALLINT,
            PostgresqlType::FLOAT,
            PostgresqlType::DOUBLE,
            PostgresqlType::DECIMAL,
        ];

        if (in_array($originType, $textTypes, true) && in_array($type, $numericTypes, true)) {
            return sprintf('USING trim(%s)::%s', $this->db->quoteName($column), $type);
        }

        return null;
    }
474991
public static function fromColumn(Db\Column $column)
    {
        $data = $column->toArray();
        if (isset($data['type']) && is_integer($data['type'])) {
            $data['type'] = self::getTypeName($data['type']);
        }
        if (isset($data['bindType']) && is_integer($data['bindType'])) {
            $data['bindType'] = self::getBindName($data['bindType']);
        }
        
        return new self($data);
    }
946361
public function orderAsc(string $column)
    {
        $instance = $this->orderByStrategyInstance();

        $instance->orderByStrategy()->orderAsc($column);

        return $instance;
    }
390525
protected function getDataColumn($column) {
		if (function_exists('array_column')) {
			return array_column($this->_data, $column);
		}
		
		$columnData = [];
		
		foreach ($this->_data as $row) {
			$columnData[] = $row[$column];
		}
		
		return $columnData;
	}
8642
private function columnName($column)
    {
        // Select all
        if ($column == '*') {
            return "`{$this->query['table']}`.*";
        }

        if (strpos($column, '.') === false) {
            $column = $this->query['table'] . ".{$column}";
        }

        // Regular column name
        if (strpos($column, '(') === false) {
            return str_replace(array('.'), array('`.`'), "`{$column}`");
        } else {
            return trim(str_replace(array('(', ')', '.'), array('(`', '`)', '`.`'), $column), '`');
        }
    }