AAttendrix Docsv1.0
Database
ReferenceImplemented

Database Functions & Utilities

Authoritative catalog of PostgreSQL functions, security definer contexts, and internal calculation procedures.

Database Functions & Utilities

Attendrix encapsulates core domain logic inside PostgreSQL functions to eliminate client-side race conditions, guarantee ACID transaction semantics, and optimize latency by running calculations directly inside the database engine.

Client-Invoked RPCs vs Internal Utilities

Functions directly callable by the Flutter mobile client over PostgREST RPC are detailed in RPC Reference. This page catalogs internal database utilities, calculation engines, and administrative procedures.

Security Models: DEFINER vs INVOKER

  • SECURITY DEFINER: Functions execute with the privileges of the database user who created them (postgres). Used for operations that must safely bypass RLS to read or update protected shared tables (e.g. recalculating course attendance averages, claiming background jobs, or modifying Google Calendar leases).
  • SECURITY INVOKER: Functions execute with the permissions of the calling user (auth.uid()). RLS policies are actively enforced on all internal queries.

Function Catalog

Function NameReturn TypeSecurityVolatilityArguments
_pgr_alphashapeSETOF recordINVOKERVOLATILEtext, alpha double precision DEFAULT 0, OUT seq1 bigint, OUT textgeom text
_pgr_array_reverseanyarrayINVOKERIMMUTABLEanyarray
_pgr_articulationpointsSETOF recordINVOKERIMMUTABLEedges_sql text, OUT seq integer, OUT node bigint
_pgr_astarSETOF recordINVOKERVOLATILEedges_sql text, start_vids anyarray, end_vids anyarray, directed boolean DEFAULT true, heuristic integer DEFAULT 5, factor double precision DEFAULT 1.0, epsilon double precision DEFAULT 1.0, only_cost boolean DEFAULT false, normal boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_astarSETOF recordINVOKERVOLATILEedges_sql text, combinations_sql text, directed boolean DEFAULT true, heuristic integer DEFAULT 5, factor double precision DEFAULT 1.0, epsilon double precision DEFAULT 1.0, only_cost boolean DEFAULT false, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_bdastarSETOF recordINVOKERVOLATILEtext, anyarray, anyarray, directed boolean DEFAULT true, heuristic integer DEFAULT 5, factor double precision DEFAULT 1.0, epsilon double precision DEFAULT 1.0, only_cost boolean DEFAULT false, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_bdastarSETOF recordINVOKERVOLATILEtext, text, directed boolean DEFAULT true, heuristic integer DEFAULT 5, factor double precision DEFAULT 1.0, epsilon double precision DEFAULT 1.0, only_cost boolean DEFAULT false, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_bddijkstraSETOF recordINVOKERVOLATILEtext, text, directed boolean, only_cost boolean DEFAULT false, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_bddijkstraSETOF recordINVOKERVOLATILEtext, anyarray, anyarray, directed boolean, only_cost boolean DEFAULT false, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_bellmanfordSETOF recordINVOKERIMMUTABLEedges_sql text, from_vids anyarray, to_vids anyarray, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_bellmanfordSETOF recordINVOKERIMMUTABLEedges_sql text, combinations_sql text, directed boolean, only_cost boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_biconnectedcomponentsSETOF recordINVOKERIMMUTABLEedges_sql text, OUT seq bigint, OUT component bigint, OUT edge bigint
_pgr_binarybreadthfirstsearchSETOF recordINVOKERIMMUTABLEedges_sql text, combinations_sql text, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_binarybreadthfirstsearchSETOF recordINVOKERIMMUTABLEedges_sql text, from_vids anyarray, to_vids anyarray, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_bipartiteSETOF recordINVOKERIMMUTABLEedges_sql text, OUT node bigint, OUT color bigint
_pgr_boost_versiontextINVOKERVOLATILE
_pgr_breadthfirstsearchSETOF recordINVOKERIMMUTABLEedges_sql text, from_vids anyarray, max_depth bigint, directed boolean, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_bridgesSETOF recordINVOKERIMMUTABLEedges_sql text, OUT seq integer, OUT edge bigint
_pgr_build_typetextINVOKERVOLATILE
_pgr_checkcolumnbooleanINVOKERVOLATILEtext, text, text, is_optional boolean DEFAULT false, dryrun boolean DEFAULT false
_pgr_checkquerytextINVOKERVOLATILEtext
_pgr_checkverttabrecordINVOKERVOLATILEvertname text, columnsarr text[], reporterrs integer DEFAULT 1, fnname text DEFAULT '_pgr_checkVertTab'::text, OUT sname text, OUT vname text
_pgr_chinesepostmanSETOF recordINVOKERVOLATILEedges_sql text, only_cost boolean, OUT seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_compilation_datetextINVOKERVOLATILE
_pgr_compiler_versiontextINVOKERVOLATILE
_pgr_connectedcomponentsSETOF recordINVOKERIMMUTABLEedges_sql text, OUT seq bigint, OUT component bigint, OUT node bigint
_pgr_contractionSETOF recordINVOKERVOLATILEedges_sql text, contraction_order bigint[], max_cycles integer DEFAULT 1, forbidden_vertices bigint[] DEFAULT ARRAY[]::bigint[], directed boolean DEFAULT true, OUT type text, OUT id bigint, OUT contracted_vertices bigint[], OUT source bigint, OUT target bigint, OUT cost double precision
_pgr_createindexvoidINVOKERVOLATILEtabname text, colname text, indext text, reporterrs integer DEFAULT 1, fnname text DEFAULT '_pgr_createIndex'::text
_pgr_createindexvoidINVOKERVOLATILEsname text, tname text, colname text, indext text, reporterrs integer DEFAULT 1, fnname text DEFAULT '_pgr_createIndex'::text
_pgr_cuthillmckeeorderingSETOF recordINVOKERIMMUTABLEtext, OUT seq bigint, OUT node bigint
_pgr_dagshortestpathSETOF recordINVOKERIMMUTABLEtext, text, directed boolean DEFAULT true, only_cost boolean DEFAULT false, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_dagshortestpathSETOF recordINVOKERIMMUTABLEtext, anyarray, anyarray, directed boolean DEFAULT true, only_cost boolean DEFAULT false, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_depthfirstsearchSETOF recordINVOKERVOLATILEedges_sql text, root_vids anyarray, directed boolean, max_depth bigint, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_dijkstraSETOF recordINVOKERVOLATILEedges_sql text, combinations_sql text, directed boolean, only_cost boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_dijkstraSETOF recordINVOKERVOLATILEedges_sql text, start_vids anyarray, end_vids anyarray, directed boolean DEFAULT true, only_cost boolean DEFAULT false, normal boolean DEFAULT true, n_goals bigint DEFAULT 0, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_dijkstraSETOF recordINVOKERVOLATILEedges_sql text, start_vids anyarray, end_vids anyarray, directed boolean, only_cost boolean, normal boolean, n_goals bigint, global boolean, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_dijkstraSETOF recordINVOKERVOLATILEedges_sql text, combinations_sql text, directed boolean DEFAULT true, only_cost boolean DEFAULT false, normal boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_dijkstranearSETOF recordINVOKERVOLATILEtext, bigint, anyarray, bigint, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_dijkstranearSETOF recordINVOKERVOLATILEtext, anyarray, anyarray, bigint, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_dijkstranearSETOF recordINVOKERVOLATILEtext, anyarray, bigint, bigint, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_dijkstraviaSETOF recordINVOKERVOLATILEedges_sql text, via_vids anyarray, directed boolean, strict boolean, u_turn_on_edge boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision
_pgr_drivingdistanceSETOF recordINVOKERVOLATILEedges_sql text, start_vids anyarray, distance double precision, directed boolean DEFAULT true, equicost boolean DEFAULT false, OUT seq integer, OUT from_v bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_edgecoloringSETOF recordINVOKERIMMUTABLEedges_sql text, OUT edge_id bigint, OUT color_id bigint
_pgr_edgedisjointpathsSETOF recordINVOKERVOLATILEtext, text, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_edgedisjointpathsSETOF recordINVOKERVOLATILEtext, anyarray, anyarray, directed boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_edwardmooreSETOF recordINVOKERIMMUTABLEedges_sql text, combinations_sql text, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_edwardmooreSETOF recordINVOKERIMMUTABLEedges_sql text, from_vids anyarray, to_vids anyarray, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_endpointgeometryINVOKERIMMUTABLEg geometry
_pgr_floydwarshallSETOF recordINVOKERVOLATILEedges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision
_pgr_get_statementtextINVOKERSTABLEo_sql text
_pgr_getcolumnnametextINVOKERVOLATILEtab text, col text, reporterrs integer DEFAULT 1, fnname text DEFAULT '_pgr_getColumnName'::text
_pgr_getcolumnnametextINVOKERVOLATILEsname text, tname text, col text, reporterrs integer DEFAULT 1, fnname text DEFAULT '_pgr_getColumnName'::text
_pgr_getcolumntypetextINVOKERVOLATILEtab text, col text, reporterrs integer DEFAULT 0, fnname text DEFAULT '_pgr_getColumnType'::text
_pgr_getcolumntypetextINVOKERVOLATILEsname text, tname text, cname text, reporterrs integer DEFAULT 0, fnname text DEFAULT '_pgr_getColumnType'::text
_pgr_gettablenamerecordINVOKERVOLATILEtab text, reporterrs integer DEFAULT 0, fnname text DEFAULT '_pgr_getTableName'::text, OUT sname text, OUT tname text
_pgr_git_hashtextINVOKERVOLATILE
_pgr_hawickcircuitsSETOF recordINVOKERIMMUTABLEtext, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_iscolumnindexedbooleanINVOKERVOLATILEsname text, tname text, cname text, reporterrs integer DEFAULT 1, fnname text DEFAULT '_pgr_isColumnIndexed'::text
_pgr_iscolumnindexedbooleanINVOKERVOLATILEtab text, col text, reporterrs integer DEFAULT 1, fnname text DEFAULT '_pgr_isColumnIndexed'::text
_pgr_iscolumnintablebooleanINVOKERVOLATILEtab text, col text
_pgr_isplanarbooleanINVOKERIMMUTABLEtext
_pgr_johnsonSETOF recordINVOKERVOLATILEedges_sql text, directed boolean, OUT start_vid bigint, OUT end_vid bigint, OUT agg_cost double precision
_pgr_kruskalSETOF recordINVOKERVOLATILEtext, anyarray, fn_suffix text, max_depth bigint, distance double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_kspSETOF recordINVOKERVOLATILEedges_sql text, start_vid bigint, end_vid bigint, k integer, directed boolean, heap_paths boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_lengauertarjandominatortreeSETOF recordINVOKERVOLATILEedges_sql text, root_vid bigint, OUT seq integer, OUT vid bigint, OUT idom bigint
_pgr_lib_versiontextINVOKERVOLATILE
_pgr_linegraphSETOF recordINVOKERIMMUTABLEtext, directed boolean, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT reverse_cost double precision
_pgr_linegraphfullSETOF recordINVOKERIMMUTABLEtext, OUT seq integer, OUT source bigint, OUT target bigint, OUT cost double precision, OUT edge bigint
_pgr_makeconnectedSETOF recordINVOKERIMMUTABLEtext, OUT seq bigint, OUT start_vid bigint, OUT end_vid bigint
_pgr_maxcardinalitymatchSETOF recordINVOKERVOLATILEedges_sql text, directed boolean, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint
_pgr_maxflowSETOF recordINVOKERVOLATILEedges_sql text, combinations_sql text, algorithm integer DEFAULT 1, only_flow boolean DEFAULT false, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint
_pgr_maxflowSETOF recordINVOKERVOLATILEedges_sql text, sources anyarray, targets anyarray, algorithm integer DEFAULT 1, only_flow boolean DEFAULT false, OUT seq integer, OUT edge_id bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint
_pgr_maxflowmincostSETOF recordINVOKERIMMUTABLEedges_sql text, sources anyarray, targets anyarray, only_cost boolean DEFAULT false, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_maxflowmincostSETOF recordINVOKERIMMUTABLEedges_sql text, combinations_sql text, only_cost boolean DEFAULT false, OUT seq integer, OUT edge bigint, OUT source bigint, OUT target bigint, OUT flow bigint, OUT residual_capacity bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_msgvoidINVOKERVOLATILEmsgkind integer, fnname text, msg text DEFAULT '---->OK'::text
_pgr_onerrorvoidINVOKERVOLATILEerrcond boolean, reporterrs integer, fnname text, msgerr text, hinto text DEFAULT 'No hint'::text, msgok text DEFAULT 'OK'::text
_pgr_operating_systemtextINVOKERVOLATILE
_pgr_parameter_checkbooleanINVOKERVOLATILEfn text, sql text, big boolean DEFAULT false
_pgr_pgsql_versiontextINVOKERVOLATILE
_pgr_pickdeliverSETOF recordINVOKERVOLATILEtext, text, text, factor double precision DEFAULT 1, max_cycles integer DEFAULT 10, initial_sol integer DEFAULT 4, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision
_pgr_pickdelivereuclideanSETOF recordINVOKERVOLATILEtext, text, factor double precision DEFAULT 1, max_cycles integer DEFAULT 10, initial_sol integer DEFAULT 4, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision
_pgr_pointtoidbigintINVOKERVOLATILEpoint geometry, tolerance double precision, vertname text, srid integer
_pgr_primSETOF recordINVOKERVOLATILEtext, anyarray, order_by text, max_depth bigint, distance double precision, OUT seq bigint, OUT depth bigint, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_quote_identtextINVOKERIMMUTABLEidname text
_pgr_sequentialvertexcoloringSETOF recordINVOKERIMMUTABLEedges_sql text, OUT vertex_id bigint, OUT color_id bigint
_pgr_startpointgeometryINVOKERIMMUTABLEg geometry
_pgr_stoerwagnerSETOF recordINVOKERVOLATILEedges_sql text, OUT seq integer, OUT edge bigint, OUT cost double precision, OUT mincut double precision
_pgr_strongcomponentsSETOF recordINVOKERIMMUTABLEedges_sql text, OUT seq bigint, OUT component bigint, OUT node bigint
_pgr_topologicalsortSETOF recordINVOKERVOLATILEedges_sql text, OUT seq integer, OUT sorted_v bigint
_pgr_transitiveclosureSETOF recordINVOKERVOLATILEedges_sql text, OUT seq integer, OUT vid bigint, OUT target_array bigint[]
_pgr_trspSETOF recordINVOKERVOLATILEtext, text, bigint, bigint, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_trspSETOF recordINVOKERVOLATILEtext, text, anyarray, bigint, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_trspSETOF recordINVOKERVOLATILEtext, text, bigint, anyarray, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_trspSETOF recordINVOKERIMMUTABLEsql text, source_eid integer, source_pos double precision, target_eid integer, target_pos double precision, directed boolean, has_reverse_cost boolean, turn_restrict_sql text DEFAULT NULL::text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT cost double precision
_pgr_trspSETOF recordINVOKERVOLATILEtext, text, anyarray, anyarray, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_trsp_withpointsSETOF recordINVOKERVOLATILEtext, text, text, text, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_trsp_withpointsSETOF recordINVOKERVOLATILEtext, text, text, anyarray, anyarray, directed boolean, driving_side character, details boolean, OUT seq integer, OUT path_seq integer, OUT departure bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_trspviaSETOF recordINVOKERVOLATILEtext, text, anyarray, boolean, boolean, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision
_pgr_trspvia_withpointsSETOF recordINVOKERVOLATILEtext, text, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision
_pgr_trspviaverticesSETOF recordINVOKERSTABLEsql text, vids integer[], directed boolean, has_rcost boolean, turn_restrict_sql text DEFAULT NULL::text, OUT seq integer, OUT id1 integer, OUT id2 integer, OUT id3 integer, OUT cost double precision
_pgr_tspSETOF recordINVOKERVOLATILEmatrix_row_sql text, start_id bigint DEFAULT 0, end_id bigint DEFAULT 0, max_processing_time double precision DEFAULT 'Infinity'::double precision, tries_per_temperature integer DEFAULT 500, max_changes_per_temperature integer DEFAULT 60, max_consecutive_non_changes integer DEFAULT 100, initial_temperature double precision DEFAULT 100, final_temperature double precision DEFAULT 0.1, cooling_factor double precision DEFAULT 0.9, randomize boolean DEFAULT true, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_tspeuclideanSETOF recordINVOKERVOLATILEcoordinates_sql text, start_id bigint DEFAULT 0, end_id bigint DEFAULT 0, max_processing_time double precision DEFAULT 'Infinity'::double precision, tries_per_temperature integer DEFAULT 500, max_changes_per_temperature integer DEFAULT 60, max_consecutive_non_changes integer DEFAULT 100, initial_temperature double precision DEFAULT 100, final_temperature double precision DEFAULT 0.1, cooling_factor double precision DEFAULT 0.9, randomize boolean DEFAULT true, OUT seq integer, OUT node bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_turnrestrictedpathSETOF recordINVOKERIMMUTABLEtext, text, bigint, bigint, integer, directed boolean, heap_paths boolean, stop_on_first boolean, strict boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_versionlessbooleanINVOKERVOLATILEv1 text, v2 text
_pgr_vrponedepotSETOF recordINVOKERVOLATILEtext, text, text, integer, OUT seq integer, OUT vehicle_seq integer, OUT vehicle_id bigint, OUT stop_seq integer, OUT stop_type integer, OUT stop_id bigint, OUT order_id bigint, OUT cargo double precision, OUT travel_time double precision, OUT arrival_time double precision, OUT wait_time double precision, OUT service_time double precision, OUT departure_time double precision
_pgr_withpointsSETOF recordINVOKERVOLATILEedges_sql text, points_sql text, start_pids anyarray, end_pids anyarray, directed boolean, driving_side character, details boolean, only_cost boolean DEFAULT false, normal boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_withpointsSETOF recordINVOKERVOLATILEedges_sql text, points_sql text, combinations_sql text, directed boolean, driving_side character, details boolean, only_cost boolean DEFAULT false, OUT seq integer, OUT path_seq integer, OUT start_pid bigint, OUT end_pid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_withpointsddSETOF recordINVOKERVOLATILEedges_sql text, points_sql text, start_pid anyarray, distance double precision, directed boolean DEFAULT true, driving_side character DEFAULT 'b'::bpchar, details boolean DEFAULT false, equicost boolean DEFAULT false, OUT seq integer, OUT start_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_withpointskspSETOF recordINVOKERSTABLEedges_sql text, points_sql text, start_pid bigint, end_pid bigint, k integer, directed boolean, heap_paths boolean, driving_side character, details boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_pgr_withpointsviaSETOF recordINVOKERVOLATILEtext, text, anyarray, boolean, boolean, boolean, character, boolean, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision
_pgr_withpointsviaSETOF recordINVOKERVOLATILEsql text, via_edges bigint[], fraction double precision[], directed boolean DEFAULT true, OUT seq integer, OUT path_id integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision, OUT route_agg_cost double precision
_postgis_deprecatevoidINVOKERIMMUTABLEoldname text, newname text, version text
_postgis_index_extentbox2dINVOKERSTABLEtbl regclass, col text
_postgis_join_selectivitydouble precisionINVOKERVOLATILEregclass, text, regclass, text, text DEFAULT '2'::text
_postgis_pgsql_versiontextINVOKERSTABLE
_postgis_scripts_pgsql_versiontextINVOKERIMMUTABLE
_postgis_selectivitydouble precisionINVOKERVOLATILEtbl regclass, att_name text, geom geometry, mode text DEFAULT '2'::text
_postgis_statstextINVOKERVOLATILEtbl regclass, att_name text, text DEFAULT '2'::text
_trspSETOF recordINVOKERVOLATILEtext, text, anyarray, anyarray, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_v4trspSETOF recordINVOKERVOLATILEtext, text, anyarray, anyarray, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
_v4trspSETOF recordINVOKERVOLATILEtext, text, text, directed boolean DEFAULT true, OUT seq integer, OUT path_seq integer, OUT start_vid bigint, OUT end_vid bigint, OUT node bigint, OUT edge bigint, OUT cost double precision, OUT agg_cost double precision
acquire_gcal_user_sync_leasebooleanDEFINERVOLATILEp_user_id uuid, p_worker_id text, p_lease_seconds integer DEFAULT 30
add_new_coursejsonbDEFINERVOLATILEp_course_code text, p_course_name text, p_course_type text DEFAULT 'DC'::text, p_credits smallint DEFAULT 3, p_slot text DEFAULT 'A1'::text, p_venue text DEFAULT NULL::text, p_auto_enroll boolean DEFAULT true
add_new_coursejsonbDEFINERVOLATILEp_course_code text, p_course_name text, p_course_type text DEFAULT 'DC'::text, p_credits integer DEFAULT 3, p_slot text DEFAULT 'A1'::text, p_venue text DEFAULT NULL::text, p_auto_enroll boolean DEFAULT true
addauthbooleanINVOKERVOLATILEtext
addgeometrycolumntextINVOKERVOLATILEtable_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean DEFAULT true
addgeometrycolumntextINVOKERVOLATILEcatalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean DEFAULT true
addgeometrycolumntextINVOKERSTABLEschema_name character varying, table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean DEFAULT true
boxboxINVOKERIMMUTABLEgeometry
boxboxINVOKERIMMUTABLEbox3d
box2dbox2dINVOKERIMMUTABLEgeometry
box2dbox2dINVOKERIMMUTABLEbox3d
box2df_inbox2dfINVOKERIMMUTABLEcstring
box2df_outcstringINVOKERIMMUTABLEbox2df
box3dbox3dINVOKERIMMUTABLEgeometry
box3dbox3dINVOKERIMMUTABLEbox2d
box3dtoboxboxINVOKERIMMUTABLEbox3d
byteabyteaINVOKERIMMUTABLEgeography
byteabyteaINVOKERIMMUTABLEgeometry
cancel_classbooleanDEFINERVOLATILEp_class_id uuid, p_reason text DEFAULT NULL::text
change_course_offeringjsonbDEFINERVOLATILEp_course_code text, p_new_course_id text
checkauthintegerINVOKERVOLATILEtext, text, text
checkauthintegerINVOKERVOLATILEtext, text
claim_gcal_sync_jobsTABLE(job_id bigint, job_type text, payload jsonb, status text, attempts integer, max_attempts integer, created_at timestamp with time zone, next_run_at timestamp with time zone)DEFINERVOLATILEp_worker_id text, p_batch_size integer DEFAULT 25, p_lease_minutes integer DEFAULT 5
claim_notification_jobsTABLE(job_id bigint, notification_type text, recipient_user_id uuid, recipient_batch_id text, course_id text, payload jsonb, dedup_key text, status text, attempts integer, max_attempts integer, scheduled_at timestamp with time zone)DEFINERVOLATILEp_worker_id text, p_batch_size integer DEFAULT 100, p_lease_minutes integer DEFAULT 5
complete_user_onboardingbooleanDEFINERVOLATILEp_full_name text, p_roll_number text, p_department_id text, p_batch_id text, p_current_semester smallint, p_username text DEFAULT NULL::text, p_bio text DEFAULT NULL::text
compute_challenge_expires_attimestamp with time zoneINVOKERSTABLEp_challenge_type challenge_type, p_reference_ts timestamp with time zone DEFAULT now()
compute_challenge_period_keytextINVOKERSTABLEp_challenge_type challenge_type, p_reference_ts timestamp with time zone DEFAULT now()
configure_batch_schedulejsonbDEFINERVOLATILEp_batch_id text, p_schedule_items jsonb, p_semester_id uuid DEFAULT NULL::uuid
configure_course_schedulejsonbDEFINERVOLATILEp_course_code text, p_slot text, p_batch_id text DEFAULT NULL::text, p_venue text DEFAULT NULL::text, p_semester_id uuid DEFAULT NULL::uuid
consume_oauth_stateTABLE(user_id uuid, pkce_verifier text, redirect_uri text)DEFINERVOLATILEp_state text
contains_2dbooleanINVOKERIMMUTABLEgeometry, box2df
contains_2dbooleanINVOKERIMMUTABLEbox2df, geometry
contains_2dbooleanINVOKERIMMUTABLEbox2df, box2df
create_taskTABLE(task_id uuid, created_at timestamp with time zone)DEFINERVOLATILEp_semester_id uuid, p_task_type text, p_title text, p_course_code text DEFAULT NULL::text, p_batch_id text DEFAULT NULL::text, p_description text DEFAULT NULL::text, p_due_date timestamp with time zone DEFAULT NULL::timestamp with time zone, p_exam_start timestamp with time zone DEFAULT NULL::timestamp with time zone, p_exam_end timestamp with time zone DEFAULT NULL::timestamp with time zone, p_venue text DEFAULT NULL::text, p_max_score numeric DEFAULT NULL::numeric, p_attachments jsonb DEFAULT '[]'::jsonb, p_is_visible boolean DEFAULT true
deactivate_devicebooleanDEFINERVOLATILEp_subscription_id text
delete_taskbooleanDEFINERVOLATILEp_task_id uuid
disablelongtransactionstextINVOKERVOLATILE
dropgeometrycolumntextINVOKERVOLATILEcatalog_name character varying, schema_name character varying, table_name character varying, column_name character varying
dropgeometrycolumntextINVOKERVOLATILEtable_name character varying, column_name character varying
dropgeometrycolumntextINVOKERVOLATILEschema_name character varying, table_name character varying, column_name character varying
dropgeometrytabletextINVOKERVOLATILEschema_name character varying, table_name character varying
dropgeometrytabletextINVOKERVOLATILEcatalog_name character varying, schema_name character varying, table_name character varying
dropgeometrytabletextINVOKERVOLATILEtable_name character varying
edit_classjsonbDEFINERVOLATILEp_class_id uuid, p_scheduled_start timestamp with time zone DEFAULT NULL::timestamp with time zone, p_scheduled_end timestamp with time zone DEFAULT NULL::timestamp with time zone, p_venue text DEFAULT NULL::text, p_is_cancelled boolean DEFAULT NULL::boolean, p_cancellation_reason text DEFAULT NULL::text
enablelongtransactionstextINVOKERVOLATILE
equalsbooleanINVOKERIMMUTABLEgeom1 geometry, geom2 geometry
execute_scheduler_sqlvoidDEFINERVOLATILEsql_query text
expire_stale_challengesTABLE(expired_count integer, period_keys text[])DEFINERVOLATILE
find_sridintegerINVOKERSTABLEcharacter varying, character varying, character varying
generate_batch_scheduleTABLE(success boolean, message text, generated_count integer, updated_count integer, deleted_count integer, total_classes integer, execution_time_ms numeric, validation_errors jsonb)DEFINERVOLATILEp_batch_id text, p_semester_number smallint DEFAULT NULL::smallint
generate_batch_scheduleTABLE(success boolean, message text, generated_count integer, updated_count integer, deleted_count integer, total_desired_classes integer, duration_ms numeric, error_log jsonb)DEFINERVOLATILEp_batch_id text, p_semester_number integer DEFAULT 5
generate_routing_dataset_versionjsonbDEFINERVOLATILEp_min_sample_threshold integer DEFAULT 5, p_default_walk_speed_mps double precision DEFAULT 1.30, p_auto_publish boolean DEFAULT false
geog_brin_inclusion_add_valuebooleanINVOKERVOLATILEinternal, internal, internal, internal
geographygeographyINVOKERIMMUTABLEbytea
geographygeographyINVOKERIMMUTABLEgeometry
geographygeographyINVOKERIMMUTABLEgeography, integer, boolean
geography_analyzebooleanINVOKERVOLATILEinternal
geography_cmpintegerINVOKERIMMUTABLEgeography, geography
geography_distance_knndouble precisionINVOKERIMMUTABLEgeography, geography
geography_eqbooleanINVOKERIMMUTABLEgeography, geography
geography_gebooleanINVOKERIMMUTABLEgeography, geography
geography_gist_compressinternalINVOKERVOLATILEinternal
geography_gist_consistentbooleanINVOKERVOLATILEinternal, geography, integer
geography_gist_decompressinternalINVOKERVOLATILEinternal
geography_gist_distancedouble precisionINVOKERVOLATILEinternal, geography, integer
geography_gist_penaltyinternalINVOKERVOLATILEinternal, internal, internal
geography_gist_picksplitinternalINVOKERVOLATILEinternal, internal
geography_gist_sameinternalINVOKERVOLATILEbox2d, box2d, internal
geography_gist_unioninternalINVOKERVOLATILEbytea, internal
geography_gtbooleanINVOKERIMMUTABLEgeography, geography
geography_ingeographyINVOKERIMMUTABLEcstring, oid, integer
geography_lebooleanINVOKERIMMUTABLEgeography, geography
geography_ltbooleanINVOKERIMMUTABLEgeography, geography
geography_outcstringINVOKERIMMUTABLEgeography
geography_overlapsbooleanINVOKERIMMUTABLEgeography, geography
geography_recvgeographyINVOKERIMMUTABLEinternal, oid, integer
geography_sendbyteaINVOKERIMMUTABLEgeography
geography_spgist_choose_ndvoidINVOKERIMMUTABLEinternal, internal
geography_spgist_compress_ndinternalINVOKERIMMUTABLEinternal
geography_spgist_config_ndvoidINVOKERIMMUTABLEinternal, internal
geography_spgist_inner_consistent_ndvoidINVOKERIMMUTABLEinternal, internal
geography_spgist_leaf_consistent_ndbooleanINVOKERIMMUTABLEinternal, internal
geography_spgist_picksplit_ndvoidINVOKERIMMUTABLEinternal, internal
geography_typmod_inintegerINVOKERIMMUTABLEcstring[]
geography_typmod_outcstringINVOKERIMMUTABLEinteger
geom2d_brin_inclusion_add_valuebooleanINVOKERVOLATILEinternal, internal, internal, internal
geom3d_brin_inclusion_add_valuebooleanINVOKERVOLATILEinternal, internal, internal, internal
geom4d_brin_inclusion_add_valuebooleanINVOKERVOLATILEinternal, internal, internal, internal
geometrygeometryINVOKERIMMUTABLEpoint
geometrygeometryINVOKERIMMUTABLEpath
geometrygeometryINVOKERIMMUTABLEpolygon
geometrygeometryINVOKERIMMUTABLEbox2d
geometrygeometryINVOKERIMMUTABLEbox3d
geometrygeometryINVOKERIMMUTABLEtext
geometrygeometryINVOKERIMMUTABLEgeometry, integer, boolean
geometrygeometryINVOKERIMMUTABLEgeography
geometrygeometryINVOKERIMMUTABLEbytea
geometrytypetextINVOKERIMMUTABLEgeography
geometrytypetextINVOKERIMMUTABLEgeometry
geomfromewkbgeometryINVOKERIMMUTABLEbytea
geomfromewktgeometryINVOKERIMMUTABLEtext
get_affected_gcal_users_for_batchTABLE(user_id uuid)DEFINERSTABLEp_batch_id text
get_affected_gcal_users_for_classTABLE(user_id uuid)DEFINERSTABLEp_class_id uuid
get_apodjsonbDEFINERSTABLE
get_app_bootstrap_statusTABLE(onboarding_completed boolean, needs_force_update boolean, current_version text, current_build_number integer, version_download_link text, release_notes text, is_web_available boolean)DEFINERSTABLEp_version_id text DEFAULT NULL::text
get_bus_routesjsonbDEFINERSTABLE
get_cache_metadatajsonbDEFINERVOLATILE
get_class_cancellation_statusjsonbDEFINERVOLATILEp_class_id uuid
get_classes_for_calendarjsonbDEFINERSTABLEp_dates text[]
get_classes_for_dateTABLE("classId" uuid, "courseId" text, "courseCode" text, "courseName" text, "courseType" text, "courseCategory" text, "batchId" text, "scheduledStart" timestamp with time zone, "scheduledEnd" timestamp with time zone, "scheduledDate" text, venue text, "isPlusSlot" boolean, "isAbsent" boolean, "isExtraClass" boolean)DEFINERSTABLEp_date date
get_classes_for_date_rangeTABLE("classId" uuid, "courseId" text, "courseCode" text, "courseName" text, "courseType" text, "courseCategory" text, "batchId" text, "scheduledStart" timestamp with time zone, "scheduledEnd" timestamp with time zone, "scheduledDate" text, venue text, "isPlusSlot" boolean, "isAbsent" boolean, "isExtraClass" boolean)DEFINERSTABLEp_start_date date, p_end_date date
get_classes_for_datesjsonbDEFINERSTABLEp_dates text[]
get_core_courses_for_batchTABLE(course_id text, course_code text, course_name text, credits smallint, slot text, course_type_code course_type_code)DEFINERSTABLEp_batch_id text, p_semester_number integer DEFAULT 5
get_course_setup_for_userTABLE(course_id text, course_code text, course_name text, course_type text, credits smallint, is_lab boolean, is_elective boolean, elective_category text, batch_id text, batch_label text, department_id text, slot text, venue text, is_recommended boolean, is_configured boolean, is_enrolled boolean, enrolled_students integer)DEFINERSTABLEp_batch_id text, p_semester_id uuid
get_current_classTABLE("classId" uuid, "courseId" text, "courseCode" text, "courseName" text, "courseType" text, "courseCategory" text, "batchId" text, "scheduledStart" timestamp with time zone, "scheduledEnd" timestamp with time zone, "scheduledDate" text, venue text, "isPlusSlot" boolean, "isAbsent" boolean, "isExtraClass" boolean)DEFINERSTABLE
get_dashboard_classesjsonbINVOKERSTABLE
get_date_cache_keytextDEFINERVOLATILEp_date date
get_due_mess_notificationsTABLE(recipient_user_id uuid, notification_type text, payload jsonb, dedup_key text, scheduled_at timestamp with time zone)DEFINERVOLATILEp_eval_time timestamp with time zone DEFAULT now(), p_window_minutes integer DEFAULT 5
get_elective_courses_for_batchTABLE(course_id text, course_code text, course_name text, elective_category text, credits smallint, slot text)DEFINERSTABLEp_batch_id text, p_semester_number integer DEFAULT 5
get_elective_requirements_listTABLE(elective_category text)DEFINERSTABLEp_batch_id text, p_semester_number smallint
get_gcal_vault_secrettextDEFINERVOLATILEsecret_id uuid
get_google_sync_statusTABLE(is_connected boolean, sync_status text, calendar_id text)DEFINERVOLATILE
get_lab_coursesjsonbDEFINERSTABLEp_batch_id text, p_semester_number integer DEFAULT 5
get_lab_courses_for_batchjsonbDEFINERVOLATILEp_batch_id text, p_semester_number integer DEFAULT 5
get_latest_apodTABLE(apod_date text, title text, description text, image_url text, hd_image_url text, media_type text, share_url text, copyright text, fetched_at timestamp with time zone)DEFINERVOLATILE
get_map_datajsonbDEFINERVOLATILE
get_mess_menujsonbDEFINERSTABLE
get_missed_classesjsonbINVOKERSTABLE
get_pipeline_healthTABLE(notification_queue_depth bigint, notification_oldest_age_seconds numeric, notification_archived_count bigint, gcal_queue_depth bigint, gcal_oldest_age_seconds numeric, gcal_archived_count bigint, needs_reauth_users_count bigint, processed_last_1h bigint, failed_last_1h bigint, pipeline_healthy boolean)DEFINERVOLATILE
get_profile_metadataTABLE(profile_updated_at timestamp with time zone, onboarding_completed boolean)DEFINERVOLATILE
get_proj4_from_sridtextINVOKERIMMUTABLEinteger
get_published_routing_datasetjsonbDEFINERSTABLE
get_shortest_walk_routejsonbDEFINERVOLATILEp_origin_lat double precision, p_origin_lon double precision, p_dest_lat double precision, p_dest_lon double precision, p_dest_building_id text DEFAULT NULL::text
get_today_classesTABLE("classId" uuid, "courseId" text, "courseCode" text, "courseName" text, "courseType" text, "courseCategory" text, "batchId" text, "scheduledStart" timestamp with time zone, "scheduledEnd" timestamp with time zone, "scheduledDate" text, venue text, "isPlusSlot" boolean, "isAbsent" boolean, "isExtraClass" boolean)DEFINERSTABLE
get_upcoming_busesjsonbINVOKERSTABLEp_user_lat double precision, p_user_lng double precision, p_max_radius_m double precision DEFAULT 800.0
get_upcoming_classesTABLE("classId" uuid, "courseId" text, "courseCode" text, "courseName" text, "courseType" text, "courseCategory" text, "batchId" text, "scheduledStart" timestamp with time zone, "scheduledEnd" timestamp with time zone, "scheduledDate" text, venue text, "isPlusSlot" boolean, "isAbsent" boolean, "isExtraClass" boolean)DEFINERSTABLEp_limit integer DEFAULT 10
get_user_future_classesTABLE(class_id uuid, course_id text, course_code text, course_name text, course_type_code text, is_plus_slot boolean, is_extra_class boolean, slot_name text, scheduled_start timestamp with time zone, scheduled_end timestamp with time zone, venue text, lat double precision, lng double precision)DEFINERSTABLEp_user_id uuid
get_user_profilejsonbDEFINERVOLATILE
gettransactionidxidINVOKERVOLATILE
gidx_ingidxINVOKERIMMUTABLEcstring
gidx_outcstringINVOKERIMMUTABLEgidx
gin_extract_query_trgminternalINVOKERIMMUTABLEtext, internal, smallint, internal, internal, internal, internal
gin_extract_value_trgminternalINVOKERIMMUTABLEtext, internal
gin_trgm_consistentbooleanINVOKERIMMUTABLEinternal, smallint, text, integer, internal, internal, internal, internal
gin_trgm_triconsistent"char"INVOKERIMMUTABLEinternal, smallint, text, integer, internal, internal, internal
gserialized_gist_joinsel_2ddouble precisionINVOKERVOLATILEinternal, oid, internal, smallint
gserialized_gist_joinsel_nddouble precisionINVOKERVOLATILEinternal, oid, internal, smallint
gserialized_gist_sel_2ddouble precisionINVOKERVOLATILEinternal, oid, internal, integer
gserialized_gist_sel_nddouble precisionINVOKERVOLATILEinternal, oid, internal, integer
gtrgm_compressinternalINVOKERIMMUTABLEinternal
gtrgm_consistentbooleanINVOKERIMMUTABLEinternal, text, smallint, oid, internal
gtrgm_decompressinternalINVOKERIMMUTABLEinternal
gtrgm_distancedouble precisionINVOKERIMMUTABLEinternal, text, smallint, oid, internal
gtrgm_ingtrgmINVOKERIMMUTABLEcstring
gtrgm_optionsvoidINVOKERIMMUTABLEinternal
gtrgm_outcstringINVOKERIMMUTABLEgtrgm
gtrgm_penaltyinternalINVOKERIMMUTABLEinternal, internal, internal
gtrgm_picksplitinternalINVOKERIMMUTABLEinternal, internal
gtrgm_sameinternalINVOKERIMMUTABLEgtrgm, gtrgm, internal
gtrgm_uniongtrgmINVOKERIMMUTABLEinternal, internal
internal_build_desired_classesTABLE(course_id text, scheduled_start timestamp with time zone, scheduled_end timestamp with time zone, is_plus_slot boolean)INVOKERSTABLEp_batch_id text, p_semester_id uuid, p_slot_system smallint, p_start_date date, p_end_date date
internal_calculate_user_odometerintegerDEFINERSTABLEp_user_id uuid
internal_get_batch_offeringsTABLE(course_id text, course_code text, course_slot text, batch_id text, is_mandatory boolean, course_type course_type_code)DEFINERVOLATILEp_batch_id text, p_semester_number integer DEFAULT 5
internal_get_user_contexttextDEFINERSTABLEOUT batch_id text
internal_materialize_offering_classesintegerDEFINERVOLATILEp_batch_id text, p_semester_id uuid, p_course_id text, p_slot text, p_venue text DEFAULT NULL::text
internal_reconcile_classesTABLE(generated_count integer, updated_count integer, deleted_count integer, total_desired_classes integer)INVOKERVOLATILEp_batch_id text, p_semester_id uuid, p_slot_system smallint, p_start_date date, p_end_date date
internal_schedule_projectionTABLE("classId" uuid, "courseId" text, "courseCode" text, "courseName" text, "courseType" text, "courseCategory" text, "batchId" text, "scheduledStart" timestamp with time zone, "scheduledEnd" timestamp with time zone, "scheduledDate" text, venue text, "isPlusSlot" boolean, "isAbsent" boolean, "isExtraClass" boolean)DEFINERSTABLEp_batch_id text, p_start_time timestamp with time zone DEFAULT NULL::timestamp with time zone, p_end_time timestamp with time zone DEFAULT NULL::timestamp with time zone, p_limit integer DEFAULT NULL::integer, p_upcoming boolean DEFAULT false, p_current boolean DEFAULT false
internal_validate_batch_schedulejsonbDEFINERVOLATILEp_batch_id text, p_semester_id uuid, p_slot_system smallint, p_start_date date, p_end_date date
is_adminbooleanDEFINERSTABLE
is_challenge_expiredbooleanINVOKERSTABLEp_expires_at timestamp with time zone, p_grace_minutes integer DEFAULT 0
is_contained_2dbooleanINVOKERIMMUTABLEbox2df, geometry
is_contained_2dbooleanINVOKERIMMUTABLEgeometry, box2df
is_contained_2dbooleanINVOKERIMMUTABLEbox2df, box2df
is_semester_lockedbooleanINVOKERSTABLEp_semester_id uuid
is_username_availablebooleanDEFINERSTABLEp_username text
jsonjsonINVOKERIMMUTABLEgeometry
jsonbjsonbINVOKERIMMUTABLEgeometry
lockrowintegerINVOKERVOLATILEtext, text, text, text
lockrowintegerINVOKERVOLATILEtext, text, text
lockrowintegerINVOKERVOLATILEtext, text, text, timestamp without time zone
lockrowintegerINVOKERVOLATILEtext, text, text, text, timestamp without time zone
longtransactionsenabledbooleanINVOKERVOLATILE
mark_absentjsonbDEFINERVOLATILEp_class_id uuid, p_source text DEFAULT 'manual'::text, p_reason text DEFAULT NULL::text
overlaps_2dbooleanINVOKERIMMUTABLEbox2df, geometry
overlaps_2dbooleanINVOKERIMMUTABLEbox2df, box2df
overlaps_2dbooleanINVOKERIMMUTABLEgeometry, box2df
overlaps_geogbooleanINVOKERIMMUTABLEgidx, gidx
overlaps_geogbooleanINVOKERIMMUTABLEgidx, geography
overlaps_geogbooleanINVOKERIMMUTABLEgeography, gidx
overlaps_ndbooleanINVOKERIMMUTABLEgeometry, gidx
overlaps_ndbooleanINVOKERIMMUTABLEgidx, gidx
overlaps_ndbooleanINVOKERIMMUTABLEgidx, geometry
pathpathINVOKERIMMUTABLEgeometry
pgis_asflatgeobuf_finalfnbyteaINVOKERIMMUTABLEinternal
pgis_asflatgeobuf_transfninternalINVOKERIMMUTABLEinternal, anyelement, boolean
pgis_asflatgeobuf_transfninternalINVOKERIMMUTABLEinternal, anyelement
pgis_asflatgeobuf_transfninternalINVOKERIMMUTABLEinternal, anyelement, boolean, text
pgis_asgeobuf_finalfnbyteaINVOKERIMMUTABLEinternal
pgis_asgeobuf_transfninternalINVOKERIMMUTABLEinternal, anyelement, text
pgis_asgeobuf_transfninternalINVOKERIMMUTABLEinternal, anyelement
pgis_asmvt_combinefninternalINVOKERIMMUTABLEinternal, internal
pgis_asmvt_deserialfninternalINVOKERIMMUTABLEbytea, internal
pgis_asmvt_finalfnbyteaINVOKERIMMUTABLEinternal
pgis_asmvt_serialfnbyteaINVOKERIMMUTABLEinternal
pgis_asmvt_transfninternalINVOKERIMMUTABLEinternal, anyelement
pgis_asmvt_transfninternalINVOKERIMMUTABLEinternal, anyelement, text, integer
pgis_asmvt_transfninternalINVOKERIMMUTABLEinternal, anyelement, text, integer, text
pgis_asmvt_transfninternalINVOKERIMMUTABLEinternal, anyelement, text, integer, text, text
pgis_asmvt_transfninternalINVOKERIMMUTABLEinternal, anyelement, text
pgis_geometry_accum_transfninternalINVOKERVOLATILEinternal, geometry, double precision
pgis_geometry_accum_transfninternalINVOKERVOLATILEinternal, geometry
pgis_geometry_accum_transfninternalINVOKERVOLATILEinternal, geometry, double precision, integer
pgis_geometry_clusterintersecting_finalfngeometry[]INVOKERVOLATILEinternal
pgis_geometry_clusterwithin_finalfngeometry[]INVOKERVOLATILEinternal
pgis_geometry_collect_finalfngeometryINVOKERVOLATILEinternal
pgis_geometry_makeline_finalfngeometryINVOKERVOLATILEinternal
pgis_geometry_polygonize_finalfngeometryINVOKERVOLATILEinternal
pgis_geometry_union_parallel_combinefninternalINVOKERIMMUTABLEinternal, internal
pgis_geometry_union_parallel_deserialfninternalINVOKERIMMUTABLEbytea, internal
pgis_geometry_union_parallel_finalfngeometryINVOKERIMMUTABLEinternal
pgis_geometry_union_parallel_serialfnbyteaINVOKERIMMUTABLEinternal
pgis_geometry_union_parallel_transfninternalINVOKERIMMUTABLEinternal, geometry, double precision
pgis_geometry_union_parallel_transfninternalINVOKERIMMUTABLEinternal, geometry
pgmq_archivebooleanDEFINERVOLATILEp_queue_name text, p_msg_id bigint
pgmq_deletebooleanDEFINERVOLATILEp_queue_name text, p_msg_id bigint
pgmq_readSETOF pgmq.message_recordDEFINERVOLATILEp_queue_name text, p_vt integer DEFAULT 180, p_qty integer DEFAULT 10
pgmq_sendbigintDEFINERVOLATILEp_queue_name text, p_message jsonb
pgmq_set_vtSETOF pgmq.message_recordDEFINERVOLATILEp_queue_name text, p_msg_id bigint, p_vt_offset integer
place_orderTABLE(order_id uuid, total_amount numeric)DEFINERVOLATILEp_customer_id uuid, p_vendor_id uuid, p_buyer_name text, p_buyer_phone text, p_hostel text, p_room_number text, p_delivery_notes text, p_items jsonb
pointpointINVOKERIMMUTABLEgeometry
polygonpolygonINVOKERIMMUTABLEgeometry
populate_geometry_columnsintegerINVOKERVOLATILEtbl_oid oid, use_typmod boolean DEFAULT true
populate_geometry_columnstextINVOKERVOLATILEuse_typmod boolean DEFAULT true
publish_routing_dataset_versionjsonbDEFINERVOLATILEp_version integer
record_walking_tripjsonbDEFINERVOLATILEp_origin_node_id bigint, p_destination_node_id bigint, p_started_at timestamp with time zone, p_arrived_at timestamp with time zone, p_distance_meters double precision DEFAULT NULL::double precision, p_gps_fix_count integer DEFAULT 0, p_avg_accuracy_m real DEFAULT NULL::real, p_device_metadata jsonb DEFAULT '{}'::jsonb
refresh_device_subscriptionbooleanDEFINERVOLATILEp_old_subscription_id text, p_new_subscription_id text
refresh_marketplace_feedsvoidDEFINERVOLATILE
register_deviceuuidDEFINERVOLATILEp_subscription_id text, p_platform text, p_app_version text DEFAULT NULL::text, p_device_model text DEFAULT NULL::text
release_gcal_user_sync_leasevoidDEFINERVOLATILEp_user_id uuid, p_worker_id text
remove_course_enrollmentjsonbDEFINERVOLATILEp_course_id text
report_class_cancellationjsonbDEFINERVOLATILEp_class_id uuid
reschedule_classjsonbDEFINERVOLATILEp_class_id uuid, p_scheduled_start timestamp with time zone, p_scheduled_end timestamp with time zone, p_venue text DEFAULT NULL::text
restore_classbooleanDEFINERVOLATILEp_class_id uuid
save_course_selectionjsonbDEFINERVOLATILEp_courses jsonb DEFAULT '[]'::jsonb
schedule_classjsonbDEFINERVOLATILEp_course_id text, p_scheduled_start timestamp with time zone, p_scheduled_end timestamp with time zone, p_venue text DEFAULT NULL::text, p_is_extra_class boolean DEFAULT false, p_is_plus_slot boolean DEFAULT false
search_available_coursesTABLE(course_id text, course_code text, course_name text, course_type text, credits smallint, is_lab boolean, is_elective boolean, elective_category text, batch_id text, batch_label text, department_id text, slot text, venue text, is_recommended boolean, is_configured boolean, is_enrolled boolean, enrolled_students integer)DEFINERSTABLEp_query text, p_current_batch_id text, p_semester_id uuid, p_limit integer DEFAULT 20, p_offset integer DEFAULT 0
set_limitrealINVOKERVOLATILEreal
show_limitrealINVOKERSTABLE
show_trgmtext[]INVOKERIMMUTABLEtext
similarityrealINVOKERIMMUTABLEtext, text
similarity_distrealINVOKERIMMUTABLEtext, text
similarity_opbooleanINVOKERSTABLEtext, text
spheroid_inspheroidINVOKERIMMUTABLEcstring
spheroid_outcstringINVOKERIMMUTABLEspheroid
strict_word_similarityrealINVOKERIMMUTABLEtext, text
strict_word_similarity_commutator_opbooleanINVOKERSTABLEtext, text
strict_word_similarity_dist_commutator_oprealINVOKERIMMUTABLEtext, text
strict_word_similarity_dist_oprealINVOKERIMMUTABLEtext, text
strict_word_similarity_opbooleanINVOKERSTABLEtext, text
texttextINVOKERIMMUTABLEgeometry
to_ist_datedateINVOKERSTABLEp_ts timestamp with time zone
try_advisory_xact_lockbooleanINVOKERVOLATILElock_id bigint
un_mark_absentjsonbDEFINERVOLATILEp_class_id uuid
unlockrowsintegerINVOKERVOLATILEtext
update_calendar_eventTABLE(event_id uuid, was_updated boolean, updated_at timestamp with time zone)DEFINERVOLATILEp_event_id uuid, p_event_name text DEFAULT NULL::text, p_start_date date DEFAULT NULL::date, p_end_date date DEFAULT NULL::date, p_event_type text DEFAULT NULL::text, p_description text DEFAULT NULL::text
update_taskTABLE(task_id uuid, was_updated boolean, updated_at timestamp with time zone)DEFINERVOLATILEp_task_id uuid, p_title text DEFAULT NULL::text, p_description text DEFAULT NULL::text, p_due_date timestamp with time zone DEFAULT NULL::timestamp with time zone, p_exam_start timestamp with time zone DEFAULT NULL::timestamp with time zone, p_exam_end timestamp with time zone DEFAULT NULL::timestamp with time zone, p_venue text DEFAULT NULL::text, p_max_score numeric DEFAULT NULL::numeric, p_attachments jsonb DEFAULT NULL::jsonb, p_is_visible boolean DEFAULT NULL::boolean
updategeometrysridtextINVOKERVOLATILEcatalogn_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer
updategeometrysridtextINVOKERVOLATILEcharacter varying, character varying, integer
updategeometrysridtextINVOKERVOLATILEcharacter varying, character varying, character varying, integer
upsert_gcal_vault_secretuuidDEFINERVOLATILEp_user_id uuid, p_refresh_token text
upsert_task_recordTABLE(record_id uuid, is_new_record boolean, updated_at timestamp with time zone)DEFINERVOLATILEp_task_id uuid, p_status text DEFAULT NULL::text, p_obtained_marks numeric DEFAULT NULL::numeric, p_personal_note text DEFAULT NULL::text
withdraw_cancellation_reportjsonbDEFINERVOLATILEp_class_id uuid
word_similarityrealINVOKERIMMUTABLEtext, text
word_similarity_commutator_opbooleanINVOKERSTABLEtext, text
word_similarity_dist_commutator_oprealINVOKERIMMUTABLEtext, text
word_similarity_dist_oprealINVOKERIMMUTABLEtext, text
word_similarity_opbooleanINVOKERSTABLEtext, text

Key Architectural Functions

calculate_user_attendance_v2

Recalculates comprehensive attendance metrics for a student across all enrolled courses in an active semester.

  • Security: SECURITY DEFINER
  • Signature: (p_user_id uuid, p_semester_id uuid) -> jsonb
  • Behavior: Queries total class occurrences matching the user's batch and enrolled electives up to the current date/time, joins against public.absences, and computes attendance percentage:
Attendance % = ((Total Classes - Total Absences) / Total Classes) * 100

Updates public.user_course_attendance_state atomically.

acquire_gcal_user_sync_lease

Implements distributed concurrency locking to ensure that at most one worker processes calendar reconciliation for a given user at any time.

  • Security: SECURITY DEFINER
  • Signature: (p_user_id uuid, p_worker_id text, p_lease_seconds integer) -> boolean
  • Behavior: Uses public.user_calendar_sync_leases with an expiration timestamp. Returns true if the lease was granted or safely renewed; returns false if another worker holds an active lease.

claim_gcal_sync_jobs / claim_notification_jobs

Atomically claims a batch of pending queue records for asynchronous worker execution.

  • Security: SECURITY DEFINER
  • Mechanism: Utilizes FOR UPDATE SKIP LOCKED or PGMQ visibility timeout updates to guarantee lock-free parallel worker consumption without duplicate processing.

Was this page helpful?

Your feedback directly guides the engineering documentation roadmap.

On this page