Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
database system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2006 at 20:31 UTC
Updated:
22 Feb 2008 at 20:00 UTC
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
Comment #1
Cvbge commentedAgain, 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...
Comment #2
chx commentedIf performance is an issue, multiple INSERTs in pgsql can be executed in a transaction. My experience that's faster.
Comment #3
Cvbge commentedTrue, 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?
Comment #4
Zen commentedGood values "before" the bad value get inserted.
-K
Comment #5
Crell commentedThis has been implemented in the new database system. Let's continue the discussion there: http://drupal.org/node/225450