o
    [h[                     @   sP   d dl Z d dlmZmZ d dlmZ d dlmZ d dlm	Z	 G dd deZ
dS )    N)	DataErrorInterfaceError)BaseDatabaseFeatures)is_psycopg3)cached_propertyc                       sX  e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZeZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'h dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1ddddd	Z2d
Z3dZ4e5dd Z6e5dd Z7e5dd Z8e5dd Z9e5 fddZ:e5dd Z;e5dd Z<e5dd Z=dZ>e?e@AdZB  ZCS )DatabaseFeatures)   Tz
        CREATE FUNCTION test_procedure () RETURNS void AS $$
        DECLARE
            V_I INTEGER;
        BEGIN
            V_I := 1;
        END;
    $$ LANGUAGE plpgsql;z
        CREATE FUNCTION test_procedure (P_I INTEGER) RETURNS void AS $$
        DECLARE
            V_I INTEGER;
        BEGIN
            V_I := P_I;
        END;
    $$ LANGUAGE plpgsql;>   YAMLXMLZTEXTJSONFCzsv-x-icu)ZdeterministicZnon_defaultZ
swedish_ciZvirtualz(STATEMENT_TIMESTAMP() AT TIME ZONE 'UTC'zINSERT INTO {} DEFAULT VALUESc                 C   sL   dhdhd}| j jd dr|dddhi | jr$|d	d
hi |S )NzQindexes.tests.SchemaIndexesNotPostgreSQLTests.test_create_index_ignores_opclassesz2lookup.tests.LookupTests.test_textfield_exact_null)zopclasses are PostgreSQL only.z$PostgreSQL requires casting to text.OPTIONSpoolz Pool does implicit health checkszNbackends.base.test_base.ConnectionHealthChecksTests.test_health_checks_enabledz]backends.base.test_base.ConnectionHealthChecksTests.test_set_autocommit_health_checks_enabledz>The actual query cannot be determined for server side bindingsz>backends.base.test_base.ExecuteWrapperTests.test_wrapper_debug)
connectionsettings_dictgetupdateuses_server_side_binding)selfskips r   /home/ubuntu/experiments/live_experiments/Pythonexperiments/Otree/venv/lib/python3.10/site-packages/django/db/backends/postgresql/features.pydjango_test_skipsO   s*   	
z"DatabaseFeatures.django_test_skipsc                 C   s   t  }| jr|dh |S )NzOaggregation.tests.AggregateTestCase.test_group_by_nested_expression_with_params)setr   r   )r   Zexpected_failuresr   r   r   django_test_expected_failuresp   s   	z.DatabaseFeatures.django_test_expected_failuresc                 C   s   | j jd }to|ddu S )Nr   Zserver_side_bindingT)r   r   r   r   )r   optionsr   r   r   r      s   z)DatabaseFeatures.uses_server_side_bindingc                 C   s   t rtdfS tdfS )Nz6PostgreSQL text fields cannot contain NUL (0x00) bytesz6A string literal cannot contain NUL (0x00) characters.)r   r   
ValueErrorr   r   r   r   +prohibits_null_characters_in_text_exception   s   z<DatabaseFeatures.prohibits_null_characters_in_text_exceptionc                    s   i t  jddddS )NZBigIntegerFieldZIntegerFieldZSmallIntegerField)ZPositiveBigIntegerFieldZPositiveIntegerFieldZPositiveSmallIntegerField)superintrospected_field_typesr   	__class__r   r   r       s   z)DatabaseFeatures.introspected_field_typesc                 C      | j jdkS )NiI r   Z
pg_versionr   r   r   r   is_postgresql_15      z!DatabaseFeatures.is_postgresql_15c                 C   r#   )Ni q r$   r   r   r   r   is_postgresql_16   r&   z!DatabaseFeatures.is_postgresql_16c                 C   r#   )Ni r$   r   r   r   r   is_postgresql_17   r&   z!DatabaseFeatures.is_postgresql_17r%   )D__name__
__module____qualname__Zminimum_database_versionZallows_group_by_selected_pksZcan_return_columns_from_insertZ can_return_rows_from_bulk_insertZhas_real_datatypeZhas_native_uuid_fieldZhas_native_duration_fieldZhas_native_json_fieldZcan_defer_constraint_checksZhas_select_for_updateZhas_select_for_update_nowaitZhas_select_for_update_ofZ!has_select_for_update_skip_lockedZhas_select_for_no_key_updateZcan_release_savepointsZsupports_commentsZsupports_tablespacesZsupports_transactionsZ!can_introspect_materialized_viewsZcan_distinct_on_fieldsZcan_rollback_ddlZ+schema_editor_uses_clientside_param_bindingZsupports_combined_altersZnulls_order_largestr   Zclosed_cursor_error_classZgreatest_least_ignores_nullsZcan_clone_databasesZsupports_temporal_subtractionZ%supports_slicing_ordering_in_compoundZ(create_test_procedure_without_params_sqlZ(create_test_procedure_with_int_param_sqlZrequires_casted_case_in_updatesZsupports_over_clauseZsupports_frame_exclusionZ4only_supports_unbounded_with_preceding_and_followingZ supports_aggregate_filter_clauseZsupported_explain_formatsZ&supports_deferrable_unique_constraintsZhas_json_operatorsZ-json_key_contains_list_matching_requires_listZsupports_update_conflictsZ%supports_update_conflicts_with_targetZsupports_covering_indexesZ!supports_stored_generated_columnsZ"supports_virtual_generated_columnsZcan_rename_indexZtest_collationsZtest_now_utc_templateZinsert_test_table_with_defaultsr   r   r   r   r   r    r%   r'   r(   Zsupports_unlimited_charfieldpropertyoperator
attrgetterZ*supports_nulls_distinct_unique_constraints__classcell__r   r   r!   r   r   	   s    
 





r   )r-   Z	django.dbr   r   Z django.db.backends.base.featuresr   Z)django.db.backends.postgresql.psycopg_anyr   Zdjango.utils.functionalr   r   r   r   r   r   <module>   s    