
    h\                     2    S SK Jr  S SKJr   " S S\5      rg)    )OGRGeomType)DatabaseIntrospectionc                   T   ^  \ rS rSr0 r\R                  / SQ-   rU 4S jrS rSr	U =r
$ )PostGISIntrospection   )geography_columnsgeometry_columnsraster_columnsspatial_ref_sysraster_overviewsc                 b  > U R                   (       d~  U R                  R                  5        nUR                  S5        [	        UR                  5       5      U l         S S S 5        U R                  R                  S U R                    5       5        [        TU ]%  X5      $ ! , (       d  f       NI= f)NzKSELECT oid, typname FROM pg_type WHERE typname IN ('geometry', 'geography')c              3   (   #    U  H  oS 4v   M
     g7f)GeometryFieldN ).0oids     f/var/www/html/env/lib/python3.13/site-packages/django/contrib/gis/db/backends/postgis/introspection.py	<genexpr>6PostGISIntrospection.get_field_type.<locals>.<genexpr>   s      +2I3o&2Is   )
postgis_oid_lookup
connectioncursorexecutedictfetchalldata_types_reverseupdatesuperget_field_type)self	data_typedescriptionr   	__class__s       r   r   #PostGISIntrospection.get_field_type   s    && '')VA
 +/v/@*A' * ##** +262I2I+  w%i== *)s   0B  
B.c                    U R                   R                  5        nUR                  SXR                  45        UR	                  5       nU(       d  [        SU< SUR                  < S35      eUu  pVn[        U5      R                  n0 nU R                  R                  UR                  5      S:X  a  SUS'   US:w  a  XhS'   US	:w  a  XXS
'   SSS5        Xx4$ ! , (       d  f       WW4$ = f)z
The geometry type OID used by PostGIS does not indicate the particular
type of field that a geometry column is (e.g., whether it's a
PointField or a PolygonField).  Thus, this routine queries the PostGIS
metadata tables to determine the geometry type.
a   
                SELECT t.coord_dimension, t.srid, t.type FROM (
                    SELECT * FROM geometry_columns
                    UNION ALL
                    SELECT * FROM geography_columns
                ) AS t WHERE t.f_table_name = %s AND t.f_geometry_column = %s
            z3Could not find a geometry or geography column for "z".""	geographyTi  srid   dimN)r   r   r   namefetchone	Exceptionr   djangor   get	type_code)	r    
table_namer"   r   rowr*   r(   
field_typefield_paramss	            r   get_geometry_type&PostGISIntrospection.get_geometry_type#   s     __##%NN --.	 //#C!;#3#35  %(!Cz %Z077JL&&**;+@+@A[P,0[)t|'+V$ax&)U#9 &: ''; &%: <''s   B1C
C()r   )__name__
__module____qualname____firstlineno__r   r   ignored_tablesr   r5   __static_attributes____classcell__)r#   s   @r   r   r      s-    *99 = N>&$( $(    r   N)django.contrib.gis.gdalr   +django.db.backends.postgresql.introspectionr   r   r   r>   r   <module>rA      s    / MB(0 B(r>   