LCOV - code coverage report
Current view: top level - src/backend/catalog - pg_class.c (source / functions) Coverage Total Hit
Test: Code coverage Lines: 86.7 % 15 13
Test Date: 2026-01-26 10:56:24 Functions: 100.0 % 1 1
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
Branches: 66.7 % 15 10

             Branch data     Line data    Source code
       1                 :             : /*-------------------------------------------------------------------------
       2                 :             :  *
       3                 :             :  * pg_class.c
       4                 :             :  *        routines to support manipulation of the pg_class relation
       5                 :             :  *
       6                 :             :  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
       7                 :             :  * Portions Copyright (c) 1994, Regents of the University of California
       8                 :             :  *
       9                 :             :  *
      10                 :             :  * IDENTIFICATION
      11                 :             :  *        src/backend/catalog/pg_class.c
      12                 :             :  *
      13                 :             :  *-------------------------------------------------------------------------
      14                 :             :  */
      15                 :             : #include "postgres.h"
      16                 :             : 
      17                 :             : #include "catalog/pg_class.h"
      18                 :             : 
      19                 :             : /*
      20                 :             :  * Issue an errdetail() informing that the relkind is not supported for this
      21                 :             :  * operation.
      22                 :             :  */
      23                 :             : int
      24                 :          33 : errdetail_relkind_not_supported(char relkind)
      25                 :             : {
      26   [ +  +  +  +  :          33 :         switch (relkind)
          +  +  +  +  +  
                   +  - ]
      27                 :             :         {
      28                 :             :                 case RELKIND_RELATION:
      29                 :           8 :                         return errdetail("This operation is not supported for tables.");
      30                 :             :                 case RELKIND_INDEX:
      31                 :           4 :                         return errdetail("This operation is not supported for indexes.");
      32                 :             :                 case RELKIND_SEQUENCE:
      33                 :           4 :                         return errdetail("This operation is not supported for sequences.");
      34                 :             :                 case RELKIND_TOASTVALUE:
      35                 :           1 :                         return errdetail("This operation is not supported for TOAST tables.");
      36                 :             :                 case RELKIND_VIEW:
      37                 :           7 :                         return errdetail("This operation is not supported for views.");
      38                 :             :                 case RELKIND_MATVIEW:
      39                 :           1 :                         return errdetail("This operation is not supported for materialized views.");
      40                 :             :                 case RELKIND_COMPOSITE_TYPE:
      41                 :           1 :                         return errdetail("This operation is not supported for composite types.");
      42                 :             :                 case RELKIND_FOREIGN_TABLE:
      43                 :           2 :                         return errdetail("This operation is not supported for foreign tables.");
      44                 :             :                 case RELKIND_PARTITIONED_TABLE:
      45                 :           3 :                         return errdetail("This operation is not supported for partitioned tables.");
      46                 :             :                 case RELKIND_PARTITIONED_INDEX:
      47                 :           2 :                         return errdetail("This operation is not supported for partitioned indexes.");
      48                 :             :                 default:
      49   [ #  #  #  # ]:           0 :                         elog(ERROR, "unrecognized relkind: '%c'", relkind);
      50                 :           0 :                         return 0;
      51                 :             :         }
      52                 :          33 : }
        

Generated by: LCOV version 2.3.2-1