hotel_booking.module line 899:

    uc_cart_add_item($node->nid, 1, $data);
    drupal_set_message(t('Added your booking to the cart, please note that your booking is not
                         confirmed until you <a href="!url">Complete checkout</a>', array('!url' => url('cart/checkout'))));
   $cart_item_id = db_last_insert_id('{uc_cart_products}', 'cart_item_id');

uc_cart_add_item not necessarly add node to cart, and produce warning on postgre sql 8.4 server.

  • warning: pg_query() [function.pg-query]: Query failed: ERROR: currval of sequence "uc_cart_products_cart_item_id_seq" is not yet defined in this session in .../includes/database.pgsql.inc on line 138.
  • user warning: query: SELECT CURRVAL('uc_cart_products_cart_item_id_seq') in .../includes/database.pgsql.inc on line 231.

when site visitor tries to add same hotel_room for same date twice, the second request ends up with the above warning