Is INSERT INTO … SET Standard SQL? – MySQL, PostgreSQL, MariaDB

insertmariadbMySQLpostgresqlsql-standard

I'm just wondering if this syntax is standard or where it comes from?

For example

INSERT INTO gtest3 SET gDateTime='2017-07-16 01:00:00'

You can see it documented in MySQL but PostgreSQL does not support it.

Best Answer

Apparently this is a MySQL extension, the SQL 2011 spec defines the insert grammar as,

<insert statement> ::=
INSERT INTO <insertion target> <insert columns and source>
14

<insertion target> ::=
<table name>

<insert columns and source> ::=
<from subquery>
| <from constructor>
| <from default>

<from subquery> ::=
[ <left paren> <insert column list> <right paren> ]
[ <override clause> ]
<query expression>

<from constructor> ::=
[ <left paren> <insert column list> <right paren> ]
[ <override clause> ]
<contextually typed table value constructor>

<override clause> ::=
OVERRIDING USER VALUE
| OVERRIDING SYSTEM VALUE

<from default> ::=
DEFAULT VALUES

<insert column list> ::=
<column name list>

You can see this talked about on the Pg Lists