13
13
* Portions Copyright (c) 1994, Regents of the University of California
14
14
*
15
15
* IDENTIFICATION
16
- * $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.126 2010/08/05 14:44:58 rhaas Exp $
16
+ * $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.127 2010/08/05 15:25:35 rhaas Exp $
17
17
*
18
18
*-------------------------------------------------------------------------
19
19
*/
@@ -1692,12 +1692,12 @@ ConversionIsVisible(Oid conid)
1692
1692
}
1693
1693
1694
1694
/*
1695
- * TSParserGetPrsid - find a TS parser by possibly qualified name
1695
+ * get_ts_parser_oid - find a TS parser by possibly qualified name
1696
1696
*
1697
- * If not found, returns InvalidOid if failOK , else throws error
1697
+ * If not found, returns InvalidOid if missing_ok , else throws error
1698
1698
*/
1699
1699
Oid
1700
- TSParserGetPrsid (List * names , bool failOK )
1700
+ get_ts_parser_oid (List * names , bool missing_ok )
1701
1701
{
1702
1702
char * schemaname ;
1703
1703
char * parser_name ;
@@ -1736,7 +1736,7 @@ TSParserGetPrsid(List *names, bool failOK)
1736
1736
}
1737
1737
}
1738
1738
1739
- if (!OidIsValid (prsoid ) && !failOK )
1739
+ if (!OidIsValid (prsoid ) && !missing_ok )
1740
1740
ereport (ERROR ,
1741
1741
(errcode (ERRCODE_UNDEFINED_OBJECT ),
1742
1742
errmsg ("text search parser \"%s\" does not exist" ,
@@ -1815,12 +1815,12 @@ TSParserIsVisible(Oid prsId)
1815
1815
}
1816
1816
1817
1817
/*
1818
- * TSDictionaryGetDictid - find a TS dictionary by possibly qualified name
1818
+ * get_ts_dict_oid - find a TS dictionary by possibly qualified name
1819
1819
*
1820
1820
* If not found, returns InvalidOid if failOK, else throws error
1821
1821
*/
1822
1822
Oid
1823
- TSDictionaryGetDictid (List * names , bool failOK )
1823
+ get_ts_dict_oid (List * names , bool missing_ok )
1824
1824
{
1825
1825
char * schemaname ;
1826
1826
char * dict_name ;
@@ -1859,7 +1859,7 @@ TSDictionaryGetDictid(List *names, bool failOK)
1859
1859
}
1860
1860
}
1861
1861
1862
- if (!OidIsValid (dictoid ) && !failOK )
1862
+ if (!OidIsValid (dictoid ) && !missing_ok )
1863
1863
ereport (ERROR ,
1864
1864
(errcode (ERRCODE_UNDEFINED_OBJECT ),
1865
1865
errmsg ("text search dictionary \"%s\" does not exist" ,
@@ -1939,12 +1939,12 @@ TSDictionaryIsVisible(Oid dictId)
1939
1939
}
1940
1940
1941
1941
/*
1942
- * TSTemplateGetTmplid - find a TS template by possibly qualified name
1942
+ * get_ts_template_oid - find a TS template by possibly qualified name
1943
1943
*
1944
- * If not found, returns InvalidOid if failOK , else throws error
1944
+ * If not found, returns InvalidOid if missing_ok , else throws error
1945
1945
*/
1946
1946
Oid
1947
- TSTemplateGetTmplid (List * names , bool failOK )
1947
+ get_ts_template_oid (List * names , bool missing_ok )
1948
1948
{
1949
1949
char * schemaname ;
1950
1950
char * template_name ;
@@ -1983,7 +1983,7 @@ TSTemplateGetTmplid(List *names, bool failOK)
1983
1983
}
1984
1984
}
1985
1985
1986
- if (!OidIsValid (tmploid ) && !failOK )
1986
+ if (!OidIsValid (tmploid ) && !missing_ok )
1987
1987
ereport (ERROR ,
1988
1988
(errcode (ERRCODE_UNDEFINED_OBJECT ),
1989
1989
errmsg ("text search template \"%s\" does not exist" ,
@@ -2062,12 +2062,12 @@ TSTemplateIsVisible(Oid tmplId)
2062
2062
}
2063
2063
2064
2064
/*
2065
- * TSConfigGetCfgid - find a TS config by possibly qualified name
2065
+ * get_ts_config_oid - find a TS config by possibly qualified name
2066
2066
*
2067
- * If not found, returns InvalidOid if failOK , else throws error
2067
+ * If not found, returns InvalidOid if missing_ok , else throws error
2068
2068
*/
2069
2069
Oid
2070
- TSConfigGetCfgid (List * names , bool failOK )
2070
+ get_ts_config_oid (List * names , bool missing_ok )
2071
2071
{
2072
2072
char * schemaname ;
2073
2073
char * config_name ;
@@ -2106,7 +2106,7 @@ TSConfigGetCfgid(List *names, bool failOK)
2106
2106
}
2107
2107
}
2108
2108
2109
- if (!OidIsValid (cfgoid ) && !failOK )
2109
+ if (!OidIsValid (cfgoid ) && !missing_ok )
2110
2110
ereport (ERROR ,
2111
2111
(errcode (ERRCODE_UNDEFINED_OBJECT ),
2112
2112
errmsg ("text search configuration \"%s\" does not exist" ,
@@ -2766,15 +2766,15 @@ PopOverrideSearchPath(void)
2766
2766
2767
2767
2768
2768
/*
2769
- * FindConversionByName - find a conversion by possibly qualified name
2769
+ * get_conversion_oid - find a conversion by possibly qualified name
2770
2770
*/
2771
2771
Oid
2772
- FindConversionByName (List * name )
2772
+ get_conversion_oid (List * name , bool missing_ok )
2773
2773
{
2774
2774
char * schemaname ;
2775
2775
char * conversion_name ;
2776
2776
Oid namespaceId ;
2777
- Oid conoid ;
2777
+ Oid conoid = InvalidOid ;
2778
2778
ListCell * l ;
2779
2779
2780
2780
/* deconstruct the name list */
@@ -2784,9 +2784,9 @@ FindConversionByName(List *name)
2784
2784
{
2785
2785
/* use exact schema given */
2786
2786
namespaceId = LookupExplicitNamespace (schemaname );
2787
- return GetSysCacheOid2 (CONNAMENSP ,
2788
- PointerGetDatum (conversion_name ),
2789
- ObjectIdGetDatum (namespaceId ));
2787
+ conoid = GetSysCacheOid2 (CONNAMENSP ,
2788
+ PointerGetDatum (conversion_name ),
2789
+ ObjectIdGetDatum (namespaceId ));
2790
2790
}
2791
2791
else
2792
2792
{
@@ -2809,7 +2809,12 @@ FindConversionByName(List *name)
2809
2809
}
2810
2810
2811
2811
/* Not found in path */
2812
- return InvalidOid ;
2812
+ if (!OidIsValid (conoid ) && !missing_ok )
2813
+ ereport (ERROR ,
2814
+ (errcode (ERRCODE_UNDEFINED_OBJECT ),
2815
+ errmsg ("conversion \"%s\" does not exist" ,
2816
+ NameListToString (name ))));
2817
+ return conoid ;
2813
2818
}
2814
2819
2815
2820
/*
0 commit comments