Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

SequenceFeature - invalid quoting for Postgresql adapter #161

@xorock

Description

@xorock

I'm using Postgresql schemas (without SET search_path). What I'm trying to achieve is getting getLastGeneratedValue with TableGateway when in transaction. I've added new SequenceFeature('id', 'site.table_id_seq') but this throws PDOException. Generated query is
SELECT NEXTVAL('"site.table_id_seq"') and should be SELECT NEXTVAL('"site"."table_id_seq"').

To fix this You should allow arrays as second parameter ( new SequenceFeature('id', ['site', 'table_id_seq')) and change

case 'PostgreSQL':
    $sql = 'SELECT NEXTVAL(\'"' . $this->sequenceName . '"\')';

to

case 'PostgreSQL':
    $sql = 'SELECT NEXTVAL(\'' . $platform->quoteIdentifierChain($this->sequenceName) . '\')';

Same for CURRVAL.

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