postgresql sticking "enable_seqscan=False" in a UDF sensible?
enable_seqscan=true doesn't do what you think it will.  It only allows the planner to choose that.  It doesn't force it.

Note it should be on generally anyway.  Sequential scans are far less costly in PostgreSQL than in MySQL since they scan in physical order.  There are many times when they are the cheaper plan.