Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Labels
@bertrandjamin

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /