On Wednesday, August 21, 2013 11:41:33 AM UTC-4, James Carroll wrote:
 

> I installed postgresql and psycopg2.  I had to touch up my models just a 
> little bit... it's picky about having unique=True on all foreign keys that 
> aren't primary keys
>

Do you mean the ForeignKey is unique within the "target" table or the 
"source" ?  

In all databases, the fkey should be unique in the "target" ; but the 
source table can have non-unique values.  MySQL has been historically bad 
about enforcing proper behaviors; you might have been using mysql set in 
one of the "mysql" sql modes (the default) which allows for incredibly bad 
database design and doesn't generate errors.  there are db and session 
configuration options to make it work like everything else.
 

> and I had to name my enums, and any select where code=52  (where code is a 
> String(2)) needed to be forced to string to get code='52'...
>

I miss the named enums in MySQL

I switched to bit operations when I moved to PostgreSQL years ago.  It 
worked great for me, but junior devs tend to mess up on them.  I wrote a 
dumb little class to wrap bitwise operations and make them behave MySQL 
like; I can share it if you'd like.  You basically just define the 
different values that would be in an enum, and can add/remove/check values, 
then serialize/deserialize into a value to store in the database.

And then I wrote a load tester in funkload, including a login and a few big 
> database dump style requests... and it pegged the system's CPU for 20 
> minutes without an error.  
>

That doesn't surprise me.  It's like the old adage - MySQL does things 
fast, PostgreSQL does things right.

Since you're un ubuntu, if you haven't done it yet... `apt-get install 
pg-tune` and use that to update the pg_config and kernel's shared memory 
allocation.  

I'm still uncomfortable with your multi-request session strategy though :) 

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

Reply via email to