Skip to content

When using Postgres for persistent tasks, check if libpq-table includes schema name #383

@jaronwest

Description

@jaronwest

When running gearman using Postgres, currently only the default schema can be used when specifying the table name.
If --libpq-table=someschema.gearman_table were used it would correctly generate the table on deploy in the specified schema, but the next time it is run again, it will check for table name in INFORMATION_SCHEMA.TABLES rather than breaking it into schema and table name, then generate an error that the resource already exists when it tries to create it.
A possible fix is to check before this query if the table name contains a dot (.) character and if so, break it apart and run query as TABLE_SCHEMA = and TABLE_NAME =
https://github.com/gearman/gearmand/blob/master/libgearman-server/plugins/queue/postgres/queue.cc#L207

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions