当前位置: 首页 > article >正文

PostgreSQL的交互式终端使用一系列命令来获取有关文本搜索配置对象的信息

psql(PostgreSQL 的交互式终端)中,你可以使用一系列命令来获取有关文本搜索配置对象的信息。这些命令主要围绕 \dF 系列,以及使用 SQL 查询 pg_ts_config 系统视图。以下是你可以使用的一些方法:

使用 \dF 系列命令

  1. \dF\dF+

    • \dF 列出所有文本搜索配置(text search configurations)。
    • \dF+ 提供关于每个文本搜索配置的更多详细信息。
  2. \dFp\dFp+

    • \dFp 列出所有文本搜索配置,但只显示那些属于特定模式(schema)的文本搜索配置,如果你指定了一个模式的话。
    • \dFp+ 提供关于这些配置的更多详细信息。

使用 SQL 查询

你也可以直接运行 SQL 查询来获取关于文本搜索配置的信息。以下是一些常用的查询:

  1. 查询所有文本搜索配置

    SELECT * FROM pg_ts_config;
    
  2. 查询特定模式的文本搜索配置

    SELECT * FROM pg_ts_config WHERE schemaname = 'your_schema_name';
    
  3. 查看文本搜索配置的详细信息

    SELECT cfgname, cfgowner, cfgnamespace::regnamespace::text AS schemaname, cfgparser::regproc::text AS parser
    FROM pg_ts_config;
    
  4. 查看与特定文本搜索配置关联的解析器

    SELECT cfgname, cfgparser::regproc::text AS parser
    FROM pg_ts_config
    WHERE cfgname = 'your_config_name';
    

示例

假设你有一个名为 english 的文本搜索配置,并且你想获取关于它的详细信息,你可以这样做:

  1. 使用 \dF+ 命令:

    \dF+ english
    
  2. 使用 SQL 查询:

    SELECT * FROM pg_ts_config WHERE cfgname = 'english';
    

这些命令和查询将帮助你获取有关 PostgreSQL 数据库中文本搜索配置对象的信息,包括它们的名称、所有者、所属模式以及它们使用的解析器等。

psql Support

Information about text search configuration objects can be obtained in psql using a set of commands:

\dF{d,p,t}[+] [PATTERN]

An optional + produces more details.

The optional parameter PATTERN can be the name of a text search object, optionally schema-qualified. If PATTERN is omitted then information about all visible objects will be displayed. PATTERN can be a regular expression and can provide separate patterns for the schema and object names. The following examples illustrate this:

=> \dF *fulltext*
       List of text search configurations
 Schema |  Name        | Description
--------+--------------+-------------
 public | fulltext_cfg |

=> \dF *.fulltext*
       List of text search configurations
 Schema   |  Name        | Description
----------+----------------------------
 fulltext | fulltext_cfg |
 public   | fulltext_cfg |

\dF[+] [PATTERN]
List text search configurations (add + for more detail).

=> \dF russian
            List of text search configurations
   Schema   |  Name   |            Description
------------+---------+------------------------------------
 pg_catalog | russian | configuration for russian language

=> \dF+ russian
Text search configuration "pg_catalog.russian"
Parser: "pg_catalog.default"
      Token      | Dictionaries
-----------------+--------------
 asciihword      | english_stem
 asciiword       | english_stem
 email           | simple
 file            | simple
 float           | simple
 host            | simple
 hword           | russian_stem
 hword_asciipart | english_stem
 hword_numpart   | simple
 hword_part      | russian_stem
 int             | simple
 numhword        | simple
 numword         | simple
 sfloat          | simple
 uint            | simple
 url             | simple
 url_path        | simple
 version         | simple
 word            | russian_stem

\dFd[+] [PATTERN]
List text search dictionaries (add + for more detail).

=> \dFd
                             List of text search dictionaries
   Schema   |      Name       |                        Description
------------+-----------------+-----------------------------------------------------------
 pg_catalog | arabic_stem     | snowball stemmer for arabic language
 pg_catalog | armenian_stem   | snowball stemmer for armenian language
 pg_catalog | basque_stem     | snowball stemmer for basque language
 pg_catalog | catalan_stem    | snowball stemmer for catalan language
 pg_catalog | danish_stem     | snowball stemmer for danish language
 pg_catalog | dutch_stem      | snowball stemmer for dutch language
 pg_catalog | english_stem    | snowball stemmer for english language
 pg_catalog | finnish_stem    | snowball stemmer for finnish language
 pg_catalog | french_stem     | snowball stemmer for french language
 pg_catalog | german_stem     | snowball stemmer for german language
 pg_catalog | greek_stem      | snowball stemmer for greek language
 pg_catalog | hindi_stem      | snowball stemmer for hindi language
 pg_catalog | hungarian_stem  | snowball stemmer for hungarian language
 pg_catalog | indonesian_stem | snowball stemmer for indonesian language
 pg_catalog | irish_stem      | snowball stemmer for irish language
 pg_catalog | italian_stem    | snowball stemmer for italian language
 pg_catalog | lithuanian_stem | snowball stemmer for lithuanian language
 pg_catalog | nepali_stem     | snowball stemmer for nepali language
 pg_catalog | norwegian_stem  | snowball stemmer for norwegian language
 pg_catalog | portuguese_stem | snowball stemmer for portuguese language
 pg_catalog | romanian_stem   | snowball stemmer for romanian language
 pg_catalog | russian_stem    | snowball stemmer for russian language
 pg_catalog | serbian_stem    | snowball stemmer for serbian language
 pg_catalog | simple          | simple dictionary: just lower case and check for stopword
 pg_catalog | spanish_stem    | snowball stemmer for spanish language
 pg_catalog | swedish_stem    | snowball stemmer for swedish language
 pg_catalog | tamil_stem      | snowball stemmer for tamil language
 pg_catalog | turkish_stem    | snowball stemmer for turkish language
 pg_catalog | yiddish_stem    | snowball stemmer for yiddish language

\dFp[+] [PATTERN]
List text search parsers (add + for more detail).

=> \dFp
        List of text search parsers
   Schema   |  Name   |     Description
------------+---------+---------------------
 pg_catalog | default | default word parser
=> \dFp+
    Text search parser "pg_catalog.default"
     Method      |    Function    | Description
-----------------+----------------+-------------
 Start parse     | prsd_start     |
 Get next token  | prsd_nexttoken |
 End parse       | prsd_end       |
 Get headline    | prsd_headline  |
 Get token types | prsd_lextype   |

        Token types for parser "pg_catalog.default"
   Token name    |               Description
-----------------+------------------------------------------
 asciihword      | Hyphenated word, all ASCII
 asciiword       | Word, all ASCII
 blank           | Space symbols
 email           | Email address
 entity          | XML entity
 file            | File or path name
 float           | Decimal notation
 host            | Host
 hword           | Hyphenated word, all letters
 hword_asciipart | Hyphenated word part, all ASCII
 hword_numpart   | Hyphenated word part, letters and digits
 hword_part      | Hyphenated word part, all letters
 int             | Signed integer
 numhword        | Hyphenated word, letters and digits
 numword         | Word, letters and digits
 protocol        | Protocol head
 sfloat          | Scientific notation
 tag             | XML tag
 uint            | Unsigned integer
 url             | URL
 url_path        | URL path
 version         | Version number
 word            | Word, all letters
(23 rows)

\dFt[+] [PATTERN]
List text search templates (add + for more detail).

=> \dFt
                           List of text search templates
   Schema   |   Name    |                        Description
------------+-----------+-----------------------------------------------------------
 pg_catalog | ispell    | ispell dictionary
 pg_catalog | simple    | simple dictionary: just lower case and check for stopword
 pg_catalog | snowball  | snowball stemmer
 pg_catalog | synonym   | synonym dictionary: replace word by its synonym
 pg_catalog | thesaurus | thesaurus dictionary: phrase by phrase substitution

http://www.kler.cn/a/444923.html

相关文章:

  • 【网络云计算】2024第51周-每日【2024/12/17】小测-理论-解析
  • Android Java Ubuntu系统如何编译出 libopencv_java4.so
  • 通义千问对接FreeSWITCH实现大模型呼叫中心
  • vue预览和下载 pdf、ppt、word、excel文档,文件类型为链接或者base64格式或者文件流,
  • QT笔记- QClipboard剪切板对QByteArray数据的复制与粘贴
  • 【Rust自学】3.3. 数据类型:复合类型
  • WPF Binding 绑定
  • linux常用命令(touch、cat、less、head、tail)
  • Scala的惰性求值:深入理解与实践
  • 回归预测模型 | LSTM、CNN、Transformer、TCN、串行、并行模型集合
  • 最大子数组和 最大子数组和(有长度限制) 最大m段子数组和
  • windows openssl编译x64版libssl.lib,编译x64版本libcurl.lib,支持https,vs2015编译器
  • 【NVIDIA】启动ubuntu后显卡驱动丢失
  • esp8266_TFTST7735语音识别UI界面虚拟小助手
  • 信号处理相关的东东(学习解惑)
  • 高浓度盐酸除铁的详细介绍
  • mlr3超参数Hyperparameter 自动寻找auto
  • 9_HTML5 SVG (5) --[HTML5 API 学习之旅]
  • 详解ROS环境配置:setup.bash 文件的功能与操作
  • Oracle 中什么情况下 可以使用 EXISTS 替代 IN 提高查询效率
  • 8K+Red+Raw+ProRes422分享5个影视级视频素材网站
  • mysql同一张表中数据一样的问题和解决
  • 远程桌面连接
  • vue create 创建项目 提示 Failed to check for updates 淘宝 NPM 镜像站喊你切换新域名啦
  • 如何测量分辨率
  • Java8 Stream编码问题