INSERT INTO {table} (field1, field2} VALUES (1, 2), (2, 3), (3, 4);
MySQL (including 3.23.58) supports this, whereas (Cvbge informs me that) pgSQL doesn't.

Cvbge suggested that a function might be useful - hence this issue :)

Examples of where this might be useful - Taxonomy form, profile forms, "import" modules and possibly modules like flexinode etc.

Cheers,
-K

Comments

Cvbge’s picture

Again, same problem as in http://drupal.org/node/39460:

something goes wrong, error_handler function is executed, and it needs to know it have to do some actions before inserting stuff into watchdog...

chx’s picture

If performance is an issue, multiple INSERTs in pgsql can be executed in a transaction. My experience that's faster.

Cvbge’s picture

True, but that's still not as good as COPY (but OTOH I'm not sure what impact have the fact that you'd have to use pg_put_line() ...).
And it still does not help with the error handler problem.

BTW, what happens in mysql if there is an error in one of multi-insert values? Do the whole insert fail, or do the "good" values get inserted?

Zen’s picture

Good values "before" the bad value get inserted.

-K

Crell’s picture

Version: x.y.z » 7.x-dev
Status: Active » Closed (duplicate)

This has been implemented in the new database system. Let's continue the discussion there: http://drupal.org/node/225450