当前位置:网站首页>How does PostgreSQL parse URLs
How does PostgreSQL parse URLs
2022-04-23 05:06:00 【PostgreSQLChina】
author : Wu Cong
Even though PostgreSQL A large number of data types are supported in , But for URL There seems to be no corresponding type to store . So for URL How do we deal with the data in the database ?
First of all, it depends on what you want to store URL What data is used for , If it's just for printing out when you query later , Then use varchar perhaps text And so on ?
But sometimes we're concerned about these URL Data is not just a simple query , We may hope that through these URL Be able to query some additional information , for example URL The protocol used 、 Host name and so on . Here we can use ts_debug Function to analyze .
function ts_debug Allows you to simply test a text search configuration .
ts_debug([ config regconfig, ] document text,
OUT alias text,
OUT description text,
OUT token text,
OUT dictionaries regdictionary[],
OUT dictionary regdictionary,
OUT lexemes text[])
returns setof record
ts_debug Returns a line for each token identified by the parser in the text . The returned column is :
- alias text : Short name of token type
- description text : Description of token type
- token text : Marked text
- dictionaries regdictionary[] : Configure the dictionary selected for this token type
- dictionary regdictionary : A dictionary that identifies the mark , If no dictionary can recognize it, it is NULL
- lexemes text[] :
The word position produced by the dictionary that recognizes the mark , If no dictionary can recognize it, it is NULL; An empty array ({}) Indicates that the token is recognized as a stop word
So we can use the following ways to URL To analyze :
bill@bill=>SELECT
bill-# alias
bill-# ,description
bill-# ,token
bill-# FROM ts_debug('https://blog.csdn.net/weixin_39540651');
alias | description | token
----------+---------------+-------------------------------
protocol | Protocol head | https://
url | URL | blog.csdn.net/weixin_39540651
host | Host | blog.csdn.net
url_path | URL path | /weixin_39540651
(4 rows)
Reference link :
https://stackoverflow.com/questions/41633436/datatype-for-a-url-in-postgresql
http://www.postgres.cn/docs/13/textsearch-debugging.html#TEXTSEARCH-CONFIGURATION-TESTING
版权声明
本文为[PostgreSQLChina]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220551004602.html
边栏推荐
- Backup MySQL database with Navicat
- 持续集成(CI)/持续交付(CD)如何彻底改变自动化测试
- Day.js 常用方法
- Detailed explanation of the differences between TCP and UDP
- Solve valueerror: argument must be a deny tensor: 0 - got shape [198602], but wanted [198602, 16]
- The WebService interface writes and publishes calls to the WebService interface (I)
- AQS source code reading
- C. Tree Infection(模拟+贪心)
- Chapter I overall project management of information system project manager summary
- Transaction isolation level of MySQL transactions
猜你喜欢

Sword finger offer: the path with a certain value in the binary tree (backtracking)

The 2021 more reading report was released, and the book consumption potential of post-95 and Post-00 rose

【数据库】MySQL基本操作(基操~)

COM in wine (2) -- basic code analysis

Painless upgrade of pixel series

MySQL - index

Use model load_ state_ Attributeerror appears when dict(): 'STR' object has no attribute 'copy‘
![[WinUI3]编写一个仿Explorer文件管理器](/img/3e/62794f1939da7f36f7a4e9dbf0aa7a.png)
[WinUI3]编写一个仿Explorer文件管理器

深度学习笔记 —— 物体检测和数据集 + 锚框
![[2022 ICLR] Pyramid: low complexity pyramid attention for long range spatiotemporal sequence modeling and prediction](/img/7c/51ac43080d9721f1bdc1cd78cd685b.png)
[2022 ICLR] Pyramid: low complexity pyramid attention for long range spatiotemporal sequence modeling and prediction
随机推荐
[2022 ICLR] Pyraformer: Low-Complexity Pyramidal Attention for Long-Range 时空序列建模和预测
This call when the transaction does not take effect
Details related to fingerprint payment
[winui3] Écrivez une copie du gestionnaire de fichiers Explorer
深度学习笔记 —— 微调
MySQL realizes row to column SQL
静态流水线和动态流水线的区别认识
信息学奥赛一本通 1955:【11NOIP普及组】瑞士轮 | OpenJudge 4.1 4363:瑞士轮 | 洛谷 P1309 [NOIP2011 普及组] 瑞士轮
[2022 ICLR] Pyramid: low complexity pyramid attention for long range spatiotemporal sequence modeling and prediction
多线程基本概念(并发与并行、线程与进程)和入门案例
#define 定义常量和宏,指针和结构体
[2021] Spatio-Temporal Graph Contrastive Learning
Download PDF from HowNet (I don't want to use CAJViewer anymore!!!)
js 判断数字字符串中是否含有字符
QPushButton slot function is triggered multiple times
Knowledge points sorting: ES6
DIY 一个 Excel 版的子网计算器
2022/4/22
Innovation training (IX) integration
Restful toolkit of idea plug-in