FAQ about Hologres SQL statements

Updated at:
Copy as MD

This topic lists common Hologres SQL error codes along with their causes and solutions.

HG_ERRCODE_FDW_ERROR

Error: failed to import foreign schema from odps: Can't find file system factory

  • Cause: Hologres cannot access the file system of the MaxCompute table due to a configuration error.

  • Solution: Verify your foreign server and external table configurations. Alternatively, import the data into a Hologres internal table.

ERRCODE_FDW_ERROR

Error: Failed to import foreign schema from ODPS: Authorization Failed: xxx

  • Cause: The current account does not have the required permissions on the specified MaxCompute table.

  • Solution: Grant the required permissions to the account in MaxCompute. For details, see Manage user permissions by using commands.

Error: failed to import foreign schema from odps:Table not found -xxx

  • Cause: The specified table does not exist in MaxCompute.

  • Solution: Verify that the table name and project are correct in MaxCompute.

ERRCODE_UNIQUE_VIOLATION or primary key violation

Error: Update row with Key (id)=(xxxx) multiple times or duplicate key value violates unique constraint

  • Cause: The data being written contains duplicate primary key values, which violates the unique constraint.

  • Solution:

    • If the error occurs for an INSERT statement, use the INSERT INTO xx ON CONFLICT syntax to deduplicate primary keys. For details, see INSERT ON CONFLICT(UPSERT).

    • If this error occurs with an INSERT...ON CONFLICT statement, the source data itself contains duplicate primary keys. For more information, see Common errors.

    • This error can also occur if a table has an expired time to live (TTL) and the expired data has not yet been physically deleted. In this case, use the hg_remove_duplicated_pk function to clean up the duplicate data. For details, see Common errors.

ERRCODE_CHECK_VIOLATION or partition constraint

Error: ERROR: new row for relation violates partition constraint

  • Cause: The data being inserted into a child partition table does not match the partition value definition. For example, inserting a row with a partition value other than '20240110' into a partition defined for '20240110' causes this error. Example:

    CREATE TABLE public.tbl_20240110 PARTITION OF public.tbl FOR VALUES IN('20240110');
    
    INSERT INTO public.tbl_20240110 SELECT * FROM odps_tbl where sale_date >'20240110';
    
    error: new row for relation "tbl_20240110" violates partition constraint
    
  • Solution: Ensure the data you write to a child partition table meets the partition constraint.

ERRCODE_NOT_NULL_VIOLATION or not-null constraint or UsageProblem

Error: null value in column "xxx" violates not-null constraint

  • Cause: A NULL value was written to a column that has a NOT NULL constraint.

  • Solution: Remove the rows that contain NULL values in that column, and then retry the write operation.

ERRCODE_UNDEFINED_TABLE

Error: Dispatch query failed: Table not found

  • Cause: The table does not exist. This typically occurs when the table was recently created and its metadata has not yet propagated, or when a TRUNCATE or DROP operation was performed on the table during query execution.

  • Solution: Use Query Insight in HoloWeb to check for concurrent DDL operations such as TRUNCATE or DROP. Resolve any conflicts, then retry the query. Avoid performing DDL operations on tables that are being actively queried. For details, see Query Insight.

ERRCODE_QUERY_CANCELED or Query is cancelled

Error: ERROR: canceling statement due to statement timeout

  • Cause: The query execution time exceeded the statement timeout configured on the client.

  • Solution: Optimize the query to reduce execution time, or increase the timeout duration. For details about timeout settings, see Manage queries.

Error: ERROR: Query:[xxx] Get result failed: canceling statement due to user request

  • Cause: The query was canceled, typically because a DROP or TRUNCATE operation was performed on the table during execution.

  • Solution: Use Query Insight in HoloWeb to check for conflicting DDL operations. For details, see Query Insight. Avoid running DDL operations during query execution.

Error: query is cancelled Cannot find index full ID:xxx (table id: x, index id: x) in storages or it is deleting

  • Cause: A TRUNCATE or DROP operation was performed on one of the queried tables during execution. This changed the table ID, causing the query to be canceled.

  • Solution: Use Query Insight to check whether a TRUNCATE or DROP operation ran concurrently with your query. For details, see Query Insight.

ERRCODE_FEATURE_NOT_SUPPORTED or Unsupported feature

Error: Feature not supported: insert into parent table

  • Cause: Hologres does not support inserting data directly into a parent partition table.

  • Solution: Insert data into a specific child partition table instead. For details, see CREATE PARTITION TABLE.

Error: SELECT INTO is not supported now.

  • Cause: Hologres does not support the SELECT INTO syntax.

  • Solution: Use the INSERT INTO SELECT syntax to insert data. For details, see INSERT.

Error: ALTER TABLE CHANGE OWNER is not supported in SLPM (Schema-Level Permission Mode)

  • Cause: You cannot use ALTER TABLE to change the table owner in the schema-level permission model (SLPM).

  • Solution: In the SLPM, table owners are user groups. To change a user's permissions, remove the user from the user group. For details, see Remove a user from a user group.

Error: Feature not supported: INSERT ON CONFLICT RETURNING

  • Cause: Hologres does not support the INSERT ON CONFLICT RETURNING syntax.

  • Solution: Use the INSERT ON CONFLICT syntax without the RETURNING clause. For details, see INSERT ON CONFLICT(UPSERT).

Error: ERROR: INSERT in ddl transaction is not supported now

  • Cause: By default, Hologres does not support DML statements such as INSERT within a BEGIN...COMMIT transaction block. Example:

    BEGIN;
    INSERT xxx
    commit;
    ERROR: INSERT in ddl transaction is not supported now
  • Solution: Run the INSERT statement outside the transaction, or enable DML transactions. For details, see SQL transaction capabilities.

Error: Creating publication with table that without binlog is not supported now

  • Cause: A publication was created for a table that does not have binlog enabled. Publications require binlog to subscribe to data changes.

  • Solution: Enable binlog on the table before creating the publication. You can create publications only for tables with binlog enabled. For details, see Use JDBC to consume Hologres binlogs.

Error: Feature not supported: INSERT on conflict contains un-unique column

  • Cause: The conflict target in the INSERT ON CONFLICT statement references a non-primary key column.

  • Solution: The conflict target in INSERT ON CONFLICT must reference primary key columns only.

Error: Feature not supported: UPDATE with shard keys

  • Cause: Hologres does not support UPDATE operations on primary key or distribution key columns.

  • Solution: Do not update primary key or distribution key columns. To change these values, you must DELETE the old row and INSERT a new one.

Error: time before 1925 not supported

  • Cause: Time-related functions support the range from 1925 to 2282 by default. Values outside this range cause an error.

  • Solution: For functions such as to_char, to_date, or to_timestamp, set the hg_experimental_functions_use_pg_implementation GUC parameter before the SQL statement to enable a wider time range. For details, see Date and time functions.

Error: Group by key is type of imprecise not supported

  • Cause: The GROUP BY clause references a column with an imprecise data type such as FLOAT.

  • Solution: Use precise data types instead of FLOAT in the GROUP BY clause.

Error: CREATE TABLE is not supported for current instance

  • Cause: The current instance is a Shared Cluster instance (endpoint starts with hgmc, for example hgmc-cn-xxwwwkkk), or a secondary instance. You can view the endpoint in the Hologres console. Shared Cluster instances support only external tables, not internal tables. Secondary instances are read-only.

  • Solution:

    • If you use a Shared Cluster instance, create an external table using the foreign table syntax. For details, see CREATE FOREIGN TABLE. Alternatively, use an exclusive instance to create internal tables.

    • If you use a secondary instance, you must create tables on the primary instance.

Error: ALTER TABLE ALTER COLUMN SET TYPE is not supported now

  • Cause: Hologres does not support changing a column data type with ALTER TABLE.

  • Solution: To change a column type, recreate the table with the desired column type.

Error: ERROR: Currently materialized view does not support aggregate on expressions, only support single column

  • Cause: Single-table materialized views do not support aggregate expressions on computed columns.

  • Solution: Avoid using expressions in single-table materialized views. Use single-column aggregates only. For details, see Manage materialized views by using SQL.

Error: ERROR: SELECT rule's target list has too few entries

  • Cause: Real-time materialized views do not support aggregate expressions on computed columns.

  • Solution: Avoid using expressions in real-time materialized views. For details, see Manage materialized views by using SQL.

Error: TransactionRowStore::DumpFlushDelta Not implemented

  • Cause: The current Hologres version has an implementation limitation on the DELETE FROM table USING syntax, which causes this error.

  • Solution: Rewrite the SQL statement to avoid using the USING clause for batch deletes. Use the following syntax instead:

    DELETE FROM table WHERE (col1, col2) IN ((val1, val2), ...);

ERRCODE_UNDEFINED_OBJECT

Error: column xxx does not exist

  • Cause: The specified column does not exist in the table.

  • Solution: Verify that the column name in the SQL statement is correct.

Error: Table group xxx does not exist

  • Cause: The specified table group does not exist.

  • Solution: Specify an existing table group when creating the table, or create the table group first.

Error: The specified partition does not exist

  • Cause: This error typically occurs during data writes or updates when the target child partition table does not exist.

  • Solution: Create the required child partition before writing data.

Error: create binlog reader failed: Fail to find any shards, please check if the table group is in current virtual warehouse

  • Cause: The specified table group is not loaded on the current virtual warehouse.

  • Solution: Verify that the table group is loaded on the virtual warehouse. If not, configure the virtual warehouse to load it. For details, see Authorize a virtual warehouse to access data.

ERRCODE_INSUFFICIENT_PRIVILEGE or permission denied

For permission-related errors, see the following topics:

ERRCODE_OUT_OF_MEMORY or OOM

Error: Total memory used by all existing queries exceeded memory limitation

  • Cause: The query exceeded the memory limit and triggered an out-of-memory (OOM) error.

  • Solution: For details, see Troubleshoot OOM errors.

ERRCODE_DATATYPE_MISMATCH

Error: internal error: Datasets has different schema

  • Cause: The schemas of the datasets being combined (for example, in a UNION or INSERT...SELECT statement) do not match in column count, order, or data type.

  • Solution: Ensure that the column count, order, and data types are consistent across all parts of the statement.

ERRCODE_DIVISION_BY_ZERO

  • Cause: The SQL statement contains a division by zero.

  • Solution:

    • Avoid zero divisors, or use a CASE WHEN expression to handle this case.

    • Create a MySQL-compatible extension and enable the option that allows division by zero. For details, see Migrate data from MySQL to Hologres.

ERRCODE_STRING_DATA_RIGHT_TRUNCATION

Error: value too long for type character varying(xxx)

  • Cause: The data value exceeds the character varying(n) length limit defined for the column.

  • Solution: Truncate or transform the data, increase the VARCHAR length limit, or change the column type to TEXT.

ERRCODE_PROGRAM_LIMIT_EXCEEDED or Exceed Odps scan limit

Error: Exceeds the partition limitation of 512, current match xxx partitions.

  • Cause: The query scans more than 512 partitions in the MaxCompute external table, which exceeds the default limit.

  • Solution: Add more partition filter conditions, or increase the partition scan limit by using the following GUC parameter. For details, see FAQ about MaxCompute integration.

    set hg_foreign_table_max_partition_limit =xx;

Error: Build desc failed: Exceeds the scan limitation of 200 GB, current scan xxx GB.

  • Cause: The amount of data scanned in the MaxCompute external table exceeds the 200 GB limit.

  • Solution:

    • Add more filter conditions to reduce the amount of scanned data.

    • Import the data into a Hologres internal table, which does not have a scan size limit.

ERRCODE_SYNTAX_ERROR

Error: syntax error at or near "xxxxx"

  • Cause: The SQL statement has a syntax error.

  • Solution: Review and correct the SQL syntax.

ERRCODE_UNDEFINED_FUNCTION

Error: DISTINCT is not implemented for window functions

  • Cause: Hologres does not currently support the DISTINCT keyword in window functions.

  • Solution: Remove the DISTINCT keyword from the window function.

Error: ERROR:function xxx does not exist

  • Cause: The required extension is not installed, or the function call uses invalid syntax.

  • Solution: Install the required extension or correct the function syntax.

Error: ERROR: function jsonb_set(json, text[], jsonb, boolean) does not exist

  • Cause: The argument types do not match the JSONB_SET function signature.

  • Solution: Ensure the first argument of JSONB_SET is of the JSONB type, not JSON. For details, see JSON and JSONB data types.

ERRCODE_E_R_E_READING_SQL_DATA_NOT_PERMITTED

Error: You have NO privilege 'odps:Select' on xxx

  • Cause: The current account does not have the permissions to query the MaxCompute table.

  • Solution: Grant the required permissions to the account in MaxCompute.

Error: The sensitive label of column 'xxx' is 2, but your effective label is 0

  • Cause: The current account has access to only some columns in the MaxCompute table.

  • Solution: Grant broader column-level permissions in MaxCompute, or query only the columns you have access to. For details about authorization, see Manage user permissions by using commands.

ERRCODE_DUPLICATE_OBJECT

Error: extension "xxxxx" already exists

  • Cause: The specified extension already exists in the database.

  • Solution: The extension is already installed. No action is needed. To avoid this error, use CREATE EXTENSION IF NOT EXISTS.

ERRCODE_INVALID_TEXT_REPRESENTATION or invalid input

Error: invalid input syntax for type numeric: \"\"

  • Cause: The NUMERIC column contains invalid data, such as empty strings, that cannot be parsed as a numeric value.

  • Solution: Clean the source data to ensure it conforms to the NUMERIC type. For example, convert empty strings to NULL or 0.

Error: invalid input syntax for integer: xxx

  • Cause: The INT column contains data that cannot be parsed as an integer.

  • Solution: Clean the invalid data.

ERRCODE_BAD_COPY_FILE_FORMAT

Error: missing data for column "xxx". failed to query next

  • Cause: The data file format is incorrect. This often occurs when the data contains the delimiter specified in the COPY command (such as a comma or space), resulting in a column count mismatch.

  • Solution: Clean the data or use a different delimiter that does not appear in the data values.

ERRCODE_UNDEFINED_COLUMN

Error: ERROR: INSERT has more expressions than target columns

  • Cause: The number of values in the INSERT statement exceeds the number of columns in the target table.

  • Solution: Ensure that the number of values in the INSERT statement matches the number of target columns.

ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE

Error: bigint out of range

  • Cause: The value exceeds the valid range of the BIGINT type.

  • Solution: Ensure the data is within the BIGINT range (-9223372036854775808 to 9223372036854775807), or use the NUMERIC type for larger values.

Error: numeric field overflow in function round

  • Cause: The NUMERIC value exceeds its defined precision limit.

  • Solution: Adjust the precision of the NUMERIC column to accommodate the data, or clean the data to fit the defined precision.

ERRCODE_DATETIME_FIELD_OVERFLOW

Error: InsertOverwrite insert select table data failed : column a.unsign_type does not exist

  • Cause: The specified column does not exist in the table, or a parameter name is incorrect.

  • Solution: Review and correct the SQL syntax.

Error: mismatched properties: table orientation is "column" but storage format is "sst"

  • Cause: Mismatched table properties. Column-oriented storage was specified but the storage format was set to SST, which is incompatible.

  • Solution: Review and correct the SQL statement.

ERRCODE_INVALID_DATETIME_FORMAT

Error: invalid value "" for "yyyy". Value must be an integer.

  • Cause: The data does not conform to the expected datetime format.

  • Solution: Ensure the data contains valid datetime values before writing.

ERRCODE_CHARACTER_NOT_IN_REPERTOIRE

Error: invalid byte sequence for encoding "UTF8": 0xe9 0x80

  • Cause: The data contains characters that are not valid in UTF-8 encoding.

  • Solution: Clean the invalid data.

ERRCODE_DUPLICATE_TABLE

Error: relation "xxxx" already exists

  • Cause: The specified table already exists in the database.

  • Solution: Use a different table name, or use CREATE TABLE IF NOT EXISTS to avoid the error.

ERRCODE_UNTRANSLATABLE_CHARACTER

Error: character with byte sequence 0xe4 0x9e 0xab in encoding "UTF8" has no equivalent in encoding "GBK"

  • Cause: A UTF-8 character has no equivalent in the target GBK encoding.

  • Solution: Clean the invalid data.

ERRCODE_GROUPING_ERROR

Error: column "xxx" must appear in the GROUP BY clause or be used in an aggregate function

  • Cause: A non-aggregated column in the SELECT list is not included in the GROUP BY clause. All columns in the SELECT list must either appear in GROUP BY or be used in an aggregate function.

  • Solution: Add the column to the GROUP BY clause or use it in an aggregate function.

ERRCODE_INVALID_TRANSACTION_STATE

Error: SET_TABLE_PROPERTY and CREATE TABLE statement are not in the same transaction for table

  • Cause: The CREATE TABLE and call set_table_property statements are not in the same transaction.

  • Solution: Wrap the CREATE TABLE and all call set_table_property statements in the same transaction block. Example:

    begin;
    CREATE TABLE tbl (
     xxxx
    );
    call set_table_property('tbl', 'orientation', 'xx');
    call set_table_property('tbl', 'distribution_key', 'xxx');
    commit;

ERRCODE_AMBIGUOUS_COLUMN

Error: column reference "xxx" is ambiguous

  • Cause: The column name in a JOIN query is ambiguous because it exists in multiple tables. For example, in SELECT id FROM t1 INNER JOIN t2 ON t1.id=t2.id, id in the SELECT clause is ambiguous because it could refer to either t1 or t2.

  • Solution: Qualify the column with the table name or alias (for example, t1.id).

ERRCODE_DUPLICATE_COLUMN

Error: column "xxx" specified more than once

  • Cause: A column name appears more than once in a CREATE TABLE statement.

  • Solution: Remove the duplicate column from the CREATE TABLE statement.

ERRCODE_AMBIGUOUS_FUNCTION

This error occurs when a function call matches multiple overloads and the database cannot determine which to use. To resolve this, explicitly cast the arguments to the desired data types.

ERRCODE_INVALID_COLUMN_DEFINITION

Error: invalid definition of a numeric type

  • Cause: A NUMERIC or DECIMAL column was defined without specifying its precision.

  • Solution: Specify the precision for the NUMERIC or DECIMAL column, such as NUMERIC(38, 18).

ERRCODE_CANNOT_COERCE

Error: cannot cast type date to integer

  • Cause: The DATE type cannot be cast to the INTEGER type.

  • Solution: Modify the SQL syntax to use a valid type cast.

ERRCODE_UNDEFINED_SCHEMA or ERRCODE_INVALID_SCHEMA_NAME

Error: schema "xxxx" does not exist

  • Cause: The schema does not exist in the database.

  • Solution: Verify that the schema name in the SQL statement is correct, or create the schema first.

ERRCODE_INTERNAL_ERROR

Indicates an unexpected internal error.

Error: internal error: Connect timeout, err: std_exception: Connection refused

  • Cause: The Hologres instance is unavailable or not responding.

  • Solution: Submit a support ticket to investigate the Hologres instance outage.

Error: too many shards in this instance

  • Cause: The specified shard count exceeds the instance's total shard limit.

  • Solution: Check the shard limit for your instance and reduce the shard count accordingly. For details, see Instance management.

Error: internal error: Write is not allowed in readonly mode

  • Cause: Write operations (INSERT, UPDATE, DELETE) are not supported on a secondary instance (read replica).

  • Solution: Perform write operations on the primary instance. Secondary instances support only SELECT queries.

Error: remaining connection slots are reserved for non-replication superuser connections

  • Cause: The instance has reached its maximum connection limit. Only superuser connections are allowed.

  • Solution: Use a superuser account to release idle connections. For details, see Manage connections.

Error: Build desc failed: Column type: information_schema.sql_identifier can not translate into hologres type

  • Cause: The query references system table columns with complex data types that Hologres does not support.

  • Solution: Avoid joining system tables with complex column types in Hologres queries.

Error: ERROR: commit ddl phase1 failed: DDLWrite is not allowed on replica

  • Cause: DDL operations such as modifying the IP address whitelist cannot be performed on a secondary instance.

  • Solution: Modify the IP address whitelist on the primary instance.

Error: current transaction is aborted, commands ignored until end of transaction block

  • Cause: A command in a transaction failed, and subsequent commands were issued before rolling back or ending the transaction. Example:

    begin;
    create xxxx
    
    begin;
  • Solution: Run the rollback; command to end the current transaction and roll back all uncommitted changes.

Error: query length xxxxx  exceeded the maximum 102400

  • Cause: The query length exceeds the 102,400-byte limit.

  • Solution: Rewrite the query to ensure its length is within the specified limit.

Error: Modify record by primary key is not on this table

  • Cause: This error occurs when writing data with Flink in update mode to a table that does not have a primary key.

  • Solution: Set an appropriate primary key for the destination table. For details, see Primary Key.

Error: ERROR: xxx for fe, should not be evaluated

  • Cause: The function runs in the Hologres engine, but system table queries bypass the engine. The function cannot be evaluated outside the engine context.

  • Solution: Do not use this function in queries against Hologres system tables.

Handle column names starting with a digit

Because Hologres is compatible with PostgreSQL, column names that start with a digit must be enclosed in double quotation marks (").

If a column name starts with a digit, you must enclose it in double quotation marks in your query, as shown in the following example:

select bizdate,"1_day_active_users","7_day_active_users" from t_active_users;

Error: cannot drop table because other objects depend on it

  • Cause: The table has dependent objects such as views that reference it.

  • Solution: Drop the dependent objects first, then drop the table.

Error: BinaryArray cannot contain more than 2147483646 bytes

  • Cause

    When table statistics are outdated, the optimizer may choose a suboptimal execution plan for a multi-table join, causing the total size of a single column within a batch to exceed 2 GB and trigger this error.

  • Solution

    Run the following command on the tables in the join to update their statistics:

    analyze <tablename>;

    If the error persists after updating statistics, the data may contain very large column values. Add the following GUC parameter before the SQL statement:

    set hg_experimental_query_batch_size = 1024;

Error: Cannot reserve capacity larger than 2^31 - 1 for binary

  • Cause and solution

    • Cause 1: When table statistics are outdated, a suboptimal execution plan may cause the total size of a single column within a batch to exceed 2 GB, triggering this error.

      Solution: Run the analyze command on the table to update its statistics.

      analyze <tablename>;
    • Cause 2: The data size in a table column exceeds 2 GB.

      Solution: Add the following GUC parameter before the SQL statement to reduce the batch size read by each query:

      set hg_experimental_query_batch_size = 1024;

Error: internal error: Sequence is used out

  • Cause: A serial type column has exhausted its auto-incrementing sequence values.

  • Solution:

    • If you are using the serial type, recreate the table and change the column type to bigserial.

    • Writing to a serial column acquires a table lock and can reduce concurrency. Consider avoiding the serial type if possible.

Add line breaks in SQL query results

In Hologres, to insert line breaks in SQL query results, use the escape string syntax with the E prefix. In regular strings, \n or \r\n are treated as literal characters and do not produce line breaks.

  • Examples

    -- Incorrect: does not produce a line break.
    SELECT STRING_AGG(name, '\r\n') FROM t1;
    
    -- Correct: use an escape string constant with the E prefix.
    SELECT STRING_AGG(name, E'\r\n') FROM t1;
    
    -- You can also use \n only.
    SELECT STRING_AGG(name, E'\n') FROM t1;
  • Description

    Hologres is compatible with PostgreSQL syntax. In PostgreSQL, strings prefixed with E (such as E'\n') support C-style escape sequences. In these sequences, \n represents a newline character and \r represents a carriage return.

What do I do if the NOW() function returns a delayed time?

In Hologres, the NOW() function returns the start time of the current transaction, not the real-time system clock. If the query runs within a long-running transaction or the connection is reused through a connection pool, the returned time may lag behind the actual system time.

To get the current real-time system clock, use the CLOCK_TIMESTAMP() function instead. Unlike NOW(), CLOCK_TIMESTAMP() returns the precise time at the moment of each invocation and is not affected by the transaction start time.

Does the DELETE statement support subqueries as dynamic partition selectors?

No. In Hologres, partition pruning requires partition conditions to use static values or parameterized bound values. Subqueries and dynamic expressions are not supported as partition selectors, such as WHERE ds = (SELECT MAX(ds) FROM ...).

Using a subquery as a partition condition causes partition pruning to fail, which may result in a full table scan with severely degraded performance. To avoid this issue, first query the partition value and store it in a variable, then use the static value in the DELETE statement.

How do I avoid ORCA optimizer errors without modifying GUC parameters?

You cannot resolve this known issue by rewriting SQL statements alone. To fix ORCA optimizer errors, upgrade the Hologres instance to version 4.0 or later.

Why does a new instance report errors or experience performance issues while the old instance runs normally?

New and old Hologres instances may behave differently due to version differences, compute capacity, and workload variations. A new instance may use a different engine version with stricter validation rules or changed default configurations. Additionally, the compute capacity and load profile of the new instance may differ from those of the old instance.

To resolve compatibility and performance issues on new instances, upgrade to the latest stable version of Hologres.

Error: ERROR: tables can have at most 6400 columns

  • Cause: Hologres limits each table to a maximum of 6400 columns. Even after you drop a column with DROP COLUMN, the column count in the table metadata continues to accumulate. Frequent ADD COLUMN and DROP COLUMN operations can cause the total metadata column count to exceed 6400, triggering this error.

  • Solution:

    • Short-term fix: Recreate the table and migrate the data. The new table starts with a fresh column count.

    • Long-term recommendation: Optimize the table schema by consolidating frequently changing columns into a single JSON column to avoid repeated ADD/DROP COLUMN operations.