postgresql postgres 中的@> 运算符有什么作用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36985926/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 02:15:46  来源:igfitidea点击:

what does the @> operator in postgres do?

postgresql

提问by lostdorje

I came across a query in postgres herewhich uses the @>operator on earth objects.

我在这里在 postgres 中遇到了一个查询,它使用了@>地球对象上的运算符。

I've searched everywhere, but have come up empty on the meaning of this operator (and likely others like it, eg: @<, etc...).

我到处搜索,但对这个运算符的含义一无所知(可能还有其他人喜欢它,例如:@<等...)。

>is obvious. I also found that @will take the absolute value of something. So my best guess is this does an absolute greater thancomparison of two values?

>很明显。我还发现@会取绝对值的东西。所以我最好的猜测是这absolute greater than对两个值进行了比较?

Is that correct? Is this documented somewhere in the postgres docs? I'm even more curious to understand what the operator does on earth objects.

那是对的吗?这是否记录在 postgres 文档中的某处?我更想知道操作员对地球物体做了什么。

Thanks!

谢谢!

回答by PIERRE PICAVET

According to the PostgreSQL Official Documentation

根据PostgreSQL 官方文档

intervalvalues can be written using the following verbose syntax:

[@] quantity unit [quantity unit...] [direction]where quantityis a number (possibly signed); unit is microsecond, millisecond, second, minute, hour, day, week, month, year, decade, century, millennium, or abbreviations or plurals of these units; directioncan be ago or empty. The at sign (@) is optional noise. The amounts of the different units are implicitly added with appropriate sign accounting. ago negates all the fields. This syntax is also used for interval output, if IntervalStyle is set to postgres_verbose.

interval可以使用以下详细语法编写值:

[@] quantity unit [quantity unit...] [direction]哪里quantity是一个数字(可能有签名);单位是微秒、毫秒、秒、分、小时、日、周、月、年、十年、世纪、千年,或这些单位的缩写或复数;direction可以为 ago 或为空。at 符号 (@) 是可选噪声。不同单位的数量是通过适当的符号会计隐式添加的。ago 否定所有字段。如果 IntervalStyle 设置为 ,则此语法也用于间隔输出postgres_verbose