当前位置:网站首页>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
边栏推荐
- [WinUI3]编写一个仿Explorer文件管理器
- Solve valueerror: argument must be a deny tensor: 0 - got shape [198602], but wanted [198602, 16]
- Mac 进入mysql终端命令
- Basic concepts of multithreading (concurrency and parallelism, threads and processes) and entry cases
- Learning Android II from scratch - activity
- Sword finger offer: symmetric binary tree (recursive iteration leetcode 101)
- Spell it! Two A-level universities and six B-level universities have abolished master's degree programs in software engineering!
- Acid of MySQL transaction
- [database] MySQL single table query
- TypeError: ‘Collection‘ object is not callable. If you meant to call the ......
猜你喜欢
Learning Android from scratch -- Introduction
Deep learning notes - fine tuning
2022/4/22
Use model load_ state_ Attributeerror appears when dict(): 'STR' object has no attribute 'copy‘
Learning Android V from scratch - UI
[database] MySQL single table query
The 8 diagrams let you see the execution sequence of async / await and promise step by step
Basic theory of Flink
The applet calls the function of scanning QR code and jumps to the path specified by QR code
Deep learning notes - semantic segmentation and data sets
随机推荐
Innovation training (V) mid term inspection
JS détermine si la chaîne de nombres contient des caractères
Painless upgrade of pixel series
Deep learning notes - object detection and dataset + anchor box
深度学习笔记 —— 微调
Day.js 常用方法
Define defines constants and macros, pointers and structures
什么是指令周期,机器周期,和时钟周期?
Learning Android from scratch -- baseactivity and activitycollector
mysql5. 7. X data authorization leads to 1141
Golang select priority execution
多线程基本概念(并发与并行、线程与进程)和入门案例
C# List字段排序含有数字和字符
[winui3] write an imitation Explorer file manager
Pixel mobile phone brick rescue tutorial
Streamexecutionenvironment of Flink source code
[2022 ICLR] Pyraformer: Low-Complexity Pyramidal Attention for Long-Range 时空序列建模和预测
【数据库】MySQL基本操作(基操~)
Sword finger offer: the median in the data stream (priority queue large top heap small top heap leetcode 295)
The applet calls the function of scanning QR code and jumps to the path specified by QR code