Method: Sequel::Postgres::DatasetMethods#disable_insert_returning
- Defined in:
- lib/sequel/adapters/shared/postgres.rb
permalink #disable_insert_returning ⇒ Object
Disables automatic use of INSERT … RETURNING. You can still use returning manually to force the use of RETURNING when inserting.
This is designed for cases where INSERT RETURNING cannot be used, such as when you are using partitioning with trigger functions or conditional rules, or when you are using a PostgreSQL version less than 8.2, or a PostgreSQL derivative that does not support returning.
Note that when this method is used, insert will not return the primary key of the inserted row, you will have to get the primary key of the inserted row before inserting via nextval, or after inserting via currval or lastval (making sure to use the same database connection for currval or lastval).
1881 1882 1883 |
# File 'lib/sequel/adapters/shared/postgres.rb', line 1881 def disable_insert_returning clone(:disable_insert_returning=>true) end |