什么是 postgresql 中 varbinary(10) 的等价物
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19551065/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
what is the equivalent of varbinary(10) in postgresql
提问by liv a
I'm trying to define a bit
field of 10 bytes. In SQL Server I'd use varbinary(10)
. I know that bytea
replaces varbinary (MAX)
for images, but didn't find any documentation on limiting the number of bits in it.
我正在尝试定义一个bit
10 字节的字段。在 SQL Server 中,我会使用varbinary(10)
. 我知道bytea
替换varbinary (MAX)
图像,但没有找到任何关于限制位数的文档。
Is there a way to do that?
有没有办法做到这一点?
回答by Leo
you want to look at bit(n), not bytea
你想看 bit(n),而不是 bytea
http://www.postgresql.org/docs/current/static/datatype-bit.html
http://www.postgresql.org/docs/current/static/datatype-bit.html