Skip to content

Fix logerrors type in pg_exttable #21

Closed

Description

@my-ship-it

logerrors in pg_exttable is char. Spike whether we need to change it bool?

postgres=# select version();
----------------------------------------------------------------------------------------
 PostgreSQL 14.4 (Cloudberry Database 1.3.0 build commit:bb9d07938bab13f6117bd565d5c71ca878bc4dbe) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11), 64-bit compiled on May 24 2023 16:39:21
(1 row)


postgres=# \d pg_exttable;
               View "pg_catalog.pg_exttable"
     Column      |  Type   | Collation | Nullable | Default 
-----------------+---------+-----------+----------+---------
 reloid          | oid     |           |          | 
 urilocation     | text[]  |           |          | 
 execlocation    | text[]  |           |          | 
 fmttype         | "char"  |           |          | 
 fmtopts         | text    |           |          | 
 options         | text[]  |           |          | 
 command         | text    |           |          | 
 rejectlimit     | integer |           |          | 
 rejectlimittype | "char"  |           |          | 
 logerrors       | "char"  |           |          | 
 encoding        | integer |           |          | 
 writable        | boolean |           |          | 


db1=# select version();

---------------------------------
 PostgreSQL 12.12 (Greenplum Database 7.0.0-beta.4 build commit:f3782c6dd89c9b6565a84518174ed4dd448f3293 Open Source) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18), 64-bit compiled on 
Jun 15 2023 01:11:10 Bhuvnesh C.
(1 row)


db_gp7=# \d pg_exttable
               View "pg_catalog.pg_exttable"
     Column      |  Type   | Collation | Nullable | Default 
-----------------+---------+-----------+----------+---------
 reloid          | oid     |           |          | 
 urilocation     | text[]  |           |          | 
 execlocation    | text[]  |           |          | 
 fmttype         | "char"  |           |          | 
 fmtopts         | text    |           |          | 
 options         | text[]  |           |          | 
 command         | text    |           |          | 
 rejectlimit     | integer |           |          | 
 rejectlimittype | "char"  |           |          | 
 logerrors       | boolean |           |          | 
 encoding        | integer |           |          | 
 writable        | boolean |           |          |

Activity

  1. Ray-Eldath commented on Aug 3, 2023

    @Ray-Eldath
    Contributor

    This problem has already been resolved in GPDB: https://github.com/greenplum-db/gpdb/pull/14123

    To sum up, it's by design. The type of logerrors has been changed from bool to char to persist the error log of external table. This is implemented by making logerrors three states ('t' - log errors into file, 'f' - disable log error, 'p' - log errors persistently) rather than a boolean. The GPDB team seems happy with the patch https://github.com/greenplum-db/gpdb/pull/14123 as it doesn't break tools because the meta still stores the three-state char and only the display is changed. We can directly cherry-pick that pr.

    More importantly this issue is a duplicate of #74, and cherry-picking the aforementioned PR is already considered a solution there. I suggest we may close one of these two issues and directly cherry-pick their changes.

  2. added a commit that references this issue on Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: BugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions