← Back to Overview

src/bin/pg_dump/pg_backup_archiver.c

Coverage: 1/1 lines (100.0%)
Total Lines
1
modified
Covered
1
100.0%
Uncovered
0
0.0%
키보드 네비게이션
_getObjectDescription() lines 3802-3887
Modified Lines Coverage: 1/1 lines (100.0%)
LineHitsSourceCommit
3802 - _getObjectDescription(PQExpBuffer buf, const TocEntry *te) -
3803 - { -
3804 - const char *type = te->desc; -
3805 - -
3806 - /* objects that don't require special decoration */ -
3807 - if (strcmp(type, "COLLATION") == 0 || -
3808 - strcmp(type, "CONVERSION") == 0 || -
3809 - strcmp(type, "DOMAIN") == 0 || -
3810 - strcmp(type, "FOREIGN TABLE") == 0 || -
3811 - strcmp(type, "MATERIALIZED VIEW") == 0 || -
3812 17467 strcmp(type, "PROPERTY GRAPH") == 0 || 86c14eaWIP: SQL Property Graph Queries (SQL/PGQ)
3813 - strcmp(type, "SEQUENCE") == 0 || -
3814 - strcmp(type, "STATISTICS") == 0 || -
3815 - strcmp(type, "TABLE") == 0 || -
3816 - strcmp(type, "TEXT SEARCH DICTIONARY") == 0 || -
3817 - strcmp(type, "TEXT SEARCH CONFIGURATION") == 0 || -
3818 - strcmp(type, "TYPE") == 0 || -
3819 - strcmp(type, "VIEW") == 0 || -
3820 - /* non-schema-specified objects */ -
3821 - strcmp(type, "DATABASE") == 0 || -
3822 - strcmp(type, "PROCEDURAL LANGUAGE") == 0 || -
3823 - strcmp(type, "SCHEMA") == 0 || -
3824 - strcmp(type, "EVENT TRIGGER") == 0 || -
3825 - strcmp(type, "FOREIGN DATA WRAPPER") == 0 || -
3826 - strcmp(type, "SERVER") == 0 || -
3827 - strcmp(type, "PUBLICATION") == 0 || -
3828 - strcmp(type, "SUBSCRIPTION") == 0) -
3829 - { -
3830 - appendPQExpBuffer(buf, "%s ", type); -
3831 - if (te->namespace && *te->namespace) -
3832 - appendPQExpBuffer(buf, "%s.", fmtId(te->namespace)); -
3833 - appendPQExpBufferStr(buf, fmtId(te->tag)); -
3834 - } -
3835 - /* LOs just have a name, but it's numeric so must not use fmtId */ -
3836 - else if (strcmp(type, "BLOB") == 0) -
3837 - { -
3838 - appendPQExpBuffer(buf, "LARGE OBJECT %s", te->tag); -
3839 - } -
3840 - -
3841 - /* -
3842 - * These object types require additional decoration. Fortunately, the -
3843 - * information needed is exactly what's in the DROP command. -
3844 - */ -
3845 - else if (strcmp(type, "AGGREGATE") == 0 || -
3846 - strcmp(type, "FUNCTION") == 0 || -
3847 - strcmp(type, "OPERATOR") == 0 || -
3848 - strcmp(type, "OPERATOR CLASS") == 0 || -
3849 - strcmp(type, "OPERATOR FAMILY") == 0 || -
3850 - strcmp(type, "PROCEDURE") == 0) -
3851 - { -
3852 - /* Chop "DROP " off the front and make a modifiable copy */ -
3853 - char *first = pg_strdup(te->dropStmt + 5); -
3854 - char *last; -
3855 - -
3856 - /* point to last character in string */ -
3857 - last = first + strlen(first) - 1; -
3858 - -
3859 - /* Strip off any ';' or '\n' at the end */ -
3860 - while (last >= first && (*last == '\n' || *last == ';')) -
3861 - last--; -
3862 - *(last + 1) = '\0'; -
3863 - -
3864 - appendPQExpBufferStr(buf, first); -
3865 - -
3866 - free(first); -
3867 - return; -
3868 - } -
3869 - /* these object types don't have separate owners */ -
3870 - else if (strcmp(type, "CAST") == 0 || -
3871 - strcmp(type, "CHECK CONSTRAINT") == 0 || -
3872 - strcmp(type, "CONSTRAINT") == 0 || -
3873 - strcmp(type, "DATABASE PROPERTIES") == 0 || -
3874 - strcmp(type, "DEFAULT") == 0 || -
3875 - strcmp(type, "FK CONSTRAINT") == 0 || -
3876 - strcmp(type, "INDEX") == 0 || -
3877 - strcmp(type, "RULE") == 0 || -
3878 - strcmp(type, "TRIGGER") == 0 || -
3879 - strcmp(type, "ROW SECURITY") == 0 || -
3880 - strcmp(type, "POLICY") == 0 || -
3881 - strcmp(type, "USER MAPPING") == 0) -
3882 - { -
3883 - /* do nothing */ -
3884 - } -
3885 - else -
3886 - pg_fatal("don't know how to set owner for object type \"%s\"", type); -
3887 - } -