Yes. This normal behavior in all relational databases. You have to
commit the change to unlock the database

  >> db.executesql('create index bq_index on bonus_queue (hitid);')
  >> db.commit()

On Mar 18, 1:51 am, Michael Toomim <too...@gmail.com> wrote:
> I can't create an index on postgresql using executesql. Here's what
> happens:
>
>   >> db.executesql('create index bq_index on bonus_queue (hitid);')
>
> ...but the index does not show up in psql. It does not return
> anything. It seems like the command might be blocking psql, because if
> I run another index command on psql:
>
>   =# create index bq_index2 on bonus_queue (reason);
>
> ...it will block (not return) until I exit the web2py process that I
> ran the executesql command from. The postgresql docs says that this
> command will lock the table from writes until it completes.
>
> BUT if I just run the command from psql without trying the
> db.executesql(), it does what it should, returning immediately with
> the message "CREATE INDEX" and shows me an index in psql:
>
>   =# \d bonus_queue
>   ...
>   Indexes:
>       "bq_index2" btree (reason)
>
> Any idea how to get db.executesql() to work?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to