On Fri, Jan 23, 2015 at 11:45 AM, SF Markus Elfring
<elfr...@users.sourceforge.net> wrote:
>>> I would expect that database implementations will provide functionality
>>> for parallel updates including concurrent creation of each table.
>>
>> What would you expect a database to do if it receives 2 "CREATE TABLE
>> my_table(...)" instructions simultaneously?
>
> This depends on the passed parameters.
>

That makes the rules complicated. At the moment, I imagine the rules
are very simple - a "CREATE TABLE" statement will fail if the table
already exists, unless "IF NOT EXISTS" is passed. Changing the rules
to allow an identical CREATE TABLE statement to silently do nothing
sounds like a lot of work for very little benefit to me.

>
>> What if the table definitions are different?
>
> I am going to pass the same settings for the application I am developing
> at the moment.

(I was talking about the general case, not your specific case)

>
>
>> One of the instructions would *have* to fail.
>
> Not in every case.
>
> The parameter "IF NOT EXISTS" could be passed to the SQL statement "CREATE 
> TABLE".
>
> * Is this setting already used by the class library "SQLAlchemy 0.9.8-78.1"?

>From a quick scan of the docs it appears not.

>
> * Does it really work in the current praxis?
>

Are you asking if "IF NOT EXISTS" will work in a high-concurrency
context? I've no idea, but this is a very PostgreSQL-specific
question, so you'd probably get a better answer from them.

Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to