33 *
44 * Copyright (c) 1996-2007, PostgreSQL Global Development Group
55 *
6- * $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.40 2007/08/21 01:11:13 tgl Exp $
6+ * $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.41 2007/08/25 17:47:44 tgl Exp $
77*/
88
99CREATE VIEW pg_roles AS
@@ -394,37 +394,19 @@ CREATE TYPE ts_debug AS (
394394" Lexized token" text
395395);
396396
397- COMMENT ON TYPE ts_debug IS ' returned type from ts_debug() function' ;
397+ COMMENT ON TYPE ts_debug IS ' type returned from ts_debug() function' ;
398398
399399CREATE FUNCTION ts_debug (regconfig,text )
400400RETURNS SETOF ts_debugAS
401401$$
402402SELECT
403- (
404- SELECT
405- tt .alias
406- FROM
407- pg_catalog .ts_token_type (
408- (SELECT cfgparserFROM pg_catalog .pg_ts_config WHERE oid = $1 )
409- )AS tt
410- WHERE
411- tt .tokid = parse .tokid
412- )AS " Alias" ,
413- (
414- SELECT
415- tt .description
416- FROM
417- pg_catalog .ts_token_type (
418- (SELECT cfgparserFROM pg_catalog .pg_ts_config WHERE oid = $1 )
419- )AS tt
420- WHERE
421- tt .tokid = parse .tokid
422- )AS " Description" ,
403+ tt .alias AS " Alias" ,
404+ tt .description AS " Description" ,
423405parse .token AS " Token" ,
424406 ARRAY (SELECT m .mapdict ::pg_catalog .regdictionary
425407FROM pg_catalog .pg_ts_config_map AS m
426408WHERE m .mapcfg = $1 AND m .maptokentype = parse .tokid
427- ORDER BY m .mapcfg , m . maptokentype , m . mapseqno )
409+ ORDER BY m .mapseqno )
428410AS " Dictionaries" ,
429411 (
430412SELECT
@@ -433,23 +415,29 @@ SELECT
433415 (SELECT mapdict,pg_catalog .ts_lexize (mapdict,parse .token )AS lex
434416FROM pg_catalog .pg_ts_config_map AS m
435417WHERE m .mapcfg = $1 AND m .maptokentype = parse .tokid
436- ORDER BY m .mapcfg , m . maptokentype , m . mapseqno ) dl
418+ ORDER BY m .mapseqno ) dl
437419WHERE dl .lex IS NOT NULL
438420LIMIT 1
439421 )AS " Lexized token"
440422FROM pg_catalog .ts_parse (
441423 (SELECT cfgparserFROM pg_catalog .pg_ts_config WHERE oid = $1 ), $2
442- )AS parse;
424+ )AS parse,
425+ pg_catalog .ts_token_type (
426+ (SELECT cfgparserFROM pg_catalog .pg_ts_config WHERE oid = $1 )
427+ )AS tt
428+ WHERE tt .tokid = parse .tokid
443429$$
444- LANGUAGE SQLRETURNS NULL ON NULL INPUT ;
430+ LANGUAGE SQLSTRICT STABLE ;
445431
446- COMMENT ON FUNCTION ts_debug(regconfig,text) IS ' debug function for text search configuration' ;
432+ COMMENT ON FUNCTION ts_debug(regconfig,text) IS
433+ ' debug function for text search configuration' ;
447434
448435CREATE FUNCTION ts_debug (text )
449436RETURNS SETOF ts_debugAS
450437$$
451- SELECT * FROM pg_catalog .ts_debug (pg_catalog .get_current_ts_config (), $1 );
438+ SELECT * FROM pg_catalog .ts_debug (pg_catalog .get_current_ts_config (), $1 );
452439$$
453- LANGUAGE SQLRETURNS NULL ON NULL INPUT ;
440+ LANGUAGE SQLSTRICT STABLE ;
454441
455- COMMENT ON FUNCTION ts_debug(text) IS ' debug function for current text search configuration' ;
442+ COMMENT ON FUNCTION ts_debug(text) IS
443+ ' debug function for current text search configuration' ;