Skip to content

Avoid back ticks on INSERT INTO columns with mode POSTGRESQL #630

Description

@bertrandjamin

Hi,

I have a problem on parsing and build an INSERT INTO query using Context::SQL_MODE_POSTGRESQL.

Given this code

$query = "INSERT INTO foo (bar, baz) VALUES ('bar', 'baz');";
Context::setMode(Context::SQL_MODE_POSTGRESQL);
$parser = new Parser($query,true);
die($parser->statements[0]->build());

The printed result is :

INSERT INTO foo(`bar`, `baz`) VALUES ('bar', 'baz')

As we can see there are back ticks around the column names. But this format is not allowed on PostgreSQL.

I tough that the line Context::setMode(Context::SQL_MODE_POSTGRESQL); should resolve this.

Did I miss something ?
Is there a way to configure the lib so the columns will be encapsulated with double quotes ?

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions