(config)
| 973 | """Target database must support two-phase transactions.""" |
| 974 | |
| 975 | def pg_prepared_transaction(config): |
| 976 | if not against(config, "postgresql"): |
| 977 | return True |
| 978 | |
| 979 | with config.db.connect() as conn: |
| 980 | try: |
| 981 | num = conn.scalar( |
| 982 | text( |
| 983 | "select cast(setting AS integer) from pg_settings " |
| 984 | "where name = 'max_prepared_transactions'" |
| 985 | ) |
| 986 | ) |
| 987 | except exc.OperationalError: |
| 988 | return False |
| 989 | else: |
| 990 | return num > 0 |
| 991 | |
| 992 | return skip_if( |
| 993 | [ |