Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-19829

should enclose column name in double quotes for PostgreSQL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • Connectors / JDBC
    • None

    Description

      when I run the sql in flink:

      create table pg_sink ( 
          Name VARCHAR, 
          address VARCHAR, 
          work VARCHAR) 
      with (   
          'connector' = 'jdbc',   
          'url' = 'jdbc:postgresql://***:***/***',    
          'table-name' = 'pg_sink', 
          ...
      ) 
      
      create table kafka_source(    
          Name VARCHAR,    
          address VARCHAR,    
          work VARCHAR
      ) with (    
          'connector.type' = 'kafka',    
          'format.type' = 'json',
          ...
      )
      
      insert into pg_sink select * from kafka_source

      the following exception happens:

      Caused by: org.postgresql.util.PSQLException: ERROR: column "Name" of relation "pg_sink" does not exist
      ...

      we can solve this problem by remove method quoteIdentifier in PostgresDialect.java, then the method quoteIdentifier in JdbcDialect.java will be used to enclose the column name in double quotes for PostgreSQL. 

      could assign this issue to me ?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Leo Zhou zhouli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: