public function lock($mode = 'update')
    {
        switch (strtolower($mode)) {
            case 'update':
                $lock = 'FOR UPDATE';
                break;
            case 'share':
                $lock = 'FOR SHARE';
                break;
            case 'no key update':
                $lock = 'FOR NO KEY UPDATE';
                break;
            case 'key share':
                $lock = 'FOR KEY SHARE';
                break;
            case false:
                $lock = false;
                break;
            default:
                throw new SqlException("Invalid PostgreSQL lock mode `'{$mode}'`.");
                break;
        }
        $this->_parts['lock'] = $lock;
        return $this;
    }