postgresql - 如何在 PostgreSQL 中用点 (".") 创建列名

标签 postgresql

<分区>

我正在尝试在 PostgreSQL 中创建表,但出现错误 创建表债券([Coupon.Type] varchar(35),[Coupon.Index] varchar(35),[Tranche.1] varchar(35),[Tranche.2] varchar(35)) 我尝试删除“[”和 Coupon.Type,还有 “Coupon.Type”,但没有任何效果。

错误:“[”处或附近的语法错误 第 1 行:房间 varchar(35),(Coupon.Type) varchar(35),[Coupon.Index] va...

最佳答案

这会起作用

create table bond 
( 
   "Coupon.Type" varchar(35)
  ,"Coupon.Index" varchar(35)
  ,"Tranche.1" varchar(35)
  ,"Tranche.2" varchar(35)
)

关于postgresql - 如何在 PostgreSQL 中用点 (".") 创建列名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44806812/

相关文章:

sql - 如何创建在日期更改时更新的 SQL 表

SQLGrammer异常 : could not execute statement

postgresql - json_each 和 json_each_text 结果具有不同的列名

postgresql - 使用 puppet 通过 VM 中的设置脚本初始化 postgresql 数据库

postgresql - 将没有长独占锁的表中的整型键更改为bigint键

sql - postgresql 中咨询锁超时

windows - postgresql V.13 Beta 3 的 Timescaledb 扩展(Windows)

c# - 连接字符串不适用于 PostgreSQL

mysql - postgreSQL 或 mySQL 更安全?

sql - Active Record查询通过关系在Rails has_many中查找符合所有条件的记录