Skip to content

Option to convert "enum" types to factor or character? #455

@DavisVaughan

Description

@DavisVaughan

My wife has a scenario where she's pulling in a number of columns that end up with a class of "pq_stuff_enum". She doesn't really care that its an enum, and would really like it to come through as a character or possibly a factor.

It seems like typcategory has a category code E for enums:
https://www.postgresql.org/docs/current/catalog-pg-type.html

I wonder if we can detect that when pulling the column in? Maybe around here?

DATA_TYPE PqResultImpl::_cache::get_column_type_from_oid(const Oid type) {

I could see a dbConnect() argument with something like enum = c("enum", "character", "factor") or something similar as a way to control how these are handled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions