【问题标题】:what's the max number of parameters you can pass into IN list of check constraint ? for PostgreSQL您可以传递到检查约束的 IN 列表中的最大参数数是多少?对于 PostgreSQL
【发布时间】:2015-08-05 10:24:14
【问题描述】:

检查约束的“IN”列表中可以添加多少个值?

alter table Customer_Part_1
add check(cust_Key in ('cust1', 'cust2', 'cust3', 'cust4', 'cust5' ................. ?? ))

【问题讨论】:

  • 具有外键约束的第二个表是一个非常更好的解决方案
  • 我相信它是无限的 - 请参阅 stackoverflow.com/questions/1009706/…,尽管它可能是检查约束中的不同限制。

标签: database postgresql


【解决方案1】:

我相信没有限制,

看看here 但我会建议使用 join 代替...尤其是在长列表中

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-19
    • 1970-01-01
    • 1970-01-01
    • 2022-12-19
    • 2011-04-23
    • 2014-11-09
    • 1970-01-01
    相关资源
    最近更新 更多