seedscoder opened a new issue, #11633:
URL: https://github.com/apache/dolphinscheduler/issues/11633

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   
   > When executing to this place, an error will be reported, whether through 
code initialization or direct execution of SQL script
   
   ```sql
   CREATE TABLE t_ds_task_definition_log (
     id int NOT NULL  ,
     code bigint NOT NULL,
     name varchar(255) DEFAULT NULL ,
     version int NOT NULL ,
     description text ,
     project_code bigint DEFAULT NULL ,
     user_id int DEFAULT NULL ,
     task_type varchar(50) DEFAULT NULL ,
     task_execute_type int(11) DEFAULT '0',
     task_params text ,
     flag int DEFAULT NULL ,
     task_priority int DEFAULT '2' ,
     worker_group varchar(255) DEFAULT NULL ,
     environment_code bigint DEFAULT '-1',
     fail_retry_times int DEFAULT NULL ,
     fail_retry_interval int DEFAULT NULL ,
     timeout_flag int DEFAULT NULL ,
     timeout_notify_strategy int DEFAULT NULL ,
     timeout int DEFAULT '0' ,
     delay_time int DEFAULT '0' ,
     resource_ids text ,
     operator int DEFAULT NULL ,
     task_group_id int DEFAULT NULL,
     task_group_priority int DEFAULT '0',
     operate_time timestamp DEFAULT NULL ,
     cpu_quota int DEFAULT '-1' NOT NULL,
     memory_max int DEFAULT '-1' NOT NULL,
     create_time timestamp DEFAULT NULL ,
     update_time timestamp DEFAULT NULL ,
     PRIMARY KEY (id)
   ) ;
   ```
   The reason for the error is:
   ```sql
   task_execute_type int(11) DEFAULT '0',
   ```
   
   
   ### What you expected to happen
   
   The initialization operation can be completed normally on the PostgreSQL 
database
   
   ### How to reproduce
   
   - Start database container
   
   ```yml
   version: '3.8'
   
   services:
     postgres:
       container_name: postgres
       image: postgres
       privileged: true
       environment:
         POSTGRES_USER: ${POSTGRES_USER:-postgres}
         POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} 
         PGDATA: /var/lib/postgresql/data
       volumes:
          - 
/home/lzb/data/docker/standalone/postgres/data:/var/lib/postgresql/data
       ports:
         - "5432:5432"
       restart: unless-stopped
   ```
   
   
   - By one of the methods:
     - `org.apache.dolphinscheduler.tools.datasource.InitDolphinScheduler#main`
   
       ```
       Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or 
near "("
         Position: 295
            at 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2675)
 ~[postgresql-42.3.4.jar:42.3.4]
            at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2365)
 ~[postgresql-42.3.4.jar:42.3.4]
            at 
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:355) 
~[postgresql-42.3.4.jar:42.3.4]
            at 
org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490) 
~[postgresql-42.3.4.jar:42.3.4]
            at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408) 
~[postgresql-42.3.4.jar:42.3.4]
            at 
org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329) 
~[postgresql-42.3.4.jar:42.3.4]
            at 
org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315) 
~[postgresql-42.3.4.jar:42.3.4]
            at 
org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291) 
~[postgresql-42.3.4.jar:42.3.4]
            at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:286) 
~[postgresql-42.3.4.jar:42.3.4]
            at 
com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) 
~[HikariCP-4.0.3.jar:na]
            at 
com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) 
~[HikariCP-4.0.3.jar:na]
            at 
org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:118)
 ~[classes/:na]
            at 
org.apache.dolphinscheduler.common.utils.ScriptRunner.runScript(ScriptRunner.java:73)
 ~[classes/:na]
            at 
org.apache.dolphinscheduler.tools.datasource.dao.UpgradeDao.runInitSql(UpgradeDao.java:111)
 ~[classes/:na]
            ... 10 common frames omitted
       ```
     -  
`dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql`
       ```
       dolphinscheduler> CREATE TABLE t_ds_task_definition_log (
                           id int NOT NULL  ,
                           code bigint NOT NULL,
                           name varchar(255) DEFAULT NULL ,
                           version int NOT NULL ,
                           description text ,
                           project_code bigint DEFAULT NULL ,
                           user_id int DEFAULT NULL ,
                           task_type varchar(50) DEFAULT NULL ,
                           task_execute_type int(11) DEFAULT '0',
                           task_params text ,
                           flag int DEFAULT NULL ,
                           task_priority int DEFAULT '2' ,
                           worker_group varchar(255) DEFAULT NULL ,
                           environment_code bigint DEFAULT '-1',
                           fail_retry_times int DEFAULT NULL ,
                           fail_retry_interval int DEFAULT NULL ,
                           timeout_flag int DEFAULT NULL ,
                           timeout_notify_strategy int DEFAULT NULL ,
                           timeout int DEFAULT '0' ,
                           delay_time int DEFAULT '0' ,
                           resource_ids text ,
                           operator int DEFAULT NULL ,
                           task_group_id int DEFAULT NULL,
                           task_group_priority int DEFAULT '0',
                           operate_time timestamp DEFAULT NULL ,
                           cpu_quota int DEFAULT '-1' NOT NULL,
                           memory_max int DEFAULT '-1' NOT NULL,
                           create_time timestamp DEFAULT NULL ,
                           update_time timestamp DEFAULT NULL ,
                           PRIMARY KEY (id)
                         )
       [2022-08-25 08:51:32] [42601] ERROR: syntax error at or near "("
       [2022-08-25 08:51:32] Position: 304
     ```
   
   
   
   
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   dev
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to