加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

什么是PostgreSQL等效SQL Server NVARCHAR?

发布时间:2020-12-13 16:44:58 所属栏目:百科 来源:网络整理
导读:如果我在Microsoft SQL Server数据库中有NVARCHAR(或NTEXT)数据类型的字段,PostgreSQL数据库中的等价数据类型是什么? 我很确定postgres varchar是相同的Oracle / Sybase / MSSQL nvarchar,即使它在手册中不是显式的: http://www.postgresql.org/docs/7.4
如果我在Microsoft SQL Server数据库中有NVARCHAR(或NTEXT)数据类型的字段,PostgreSQL数据库中的等价数据类型是什么?
我很确定postgres varchar是相同的Oracle / Sybase / MSSQL nvarchar,即使它在手册中不是显式的:

http://www.postgresql.org/docs/7.4/static/datatype-character.html

编码转换函数在这里:

http://www.postgresql.org/docs/current/static/functions-string.html
http://www.postgresql.org/docs/current/static/functions-string.html#CONVERSION-NAMES

例:

create table
nvctest (
utf8fld varchar(12)
);
insert into nvctest
select convert('PostgreSQL' using ascii_to_utf_8);
select * from nvctest;

此外,还有一个类似的问题从Postgresql代表this response:

All of our TEXT datatypes are multibyte-capable,provided you’ve installed PostgreSQL correctly. This includes: TEXT (recommended) VARCHAR CHAR

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读