(मूलतः this question का हिस्सा है, लेकिन यह थोड़ा अप्रासंगिक था, इसलिए मैं यह अपने आप में एक सवाल बनाने का फैसला किया।)ऑपरेटर ~ <~ Postgres
मैं नहीं मिल सकता है क्या ऑपरेटर ~<~
है। पोस्टग्रेस मैनुअल में केवल ~
और इसी तरह के ऑपरेटर here का उल्लेख है, लेकिन ~<~
का कोई संकेत नहीं है।
जब psql कंसोल में नगण्य, मुझे पता चला है कि इन आदेशों एक ही परिणाम दे:
SELECT * FROM test ORDER BY name USING ~<~;
SELECT * FROM test ORDER BY name COLLATE "C";
और इन रिवर्स आदेश देता है:
SELECT * FROM test ORDER BY name USING ~>~;
SELECT * FROM test ORDER BY name COLLATE "C" DESC;
इसके अलावा टिल्ड ऑपरेटरों पर कुछ जानकारी :
\do ~*~
List of operators
Schema | Name | Left arg type | Right arg type | Result type | Description
------------+------+---------------+----------------+-------------+-------------------------
pg_catalog | ~<=~ | character | character | boolean | less than or equal
pg_catalog | ~<=~ | text | text | boolean | less than or equal
pg_catalog | ~<~ | character | character | boolean | less than
pg_catalog | ~<~ | text | text | boolean | less than
pg_catalog | ~>=~ | character | character | boolean | greater than or equal
pg_catalog | ~>=~ | text | text | boolean | greater than or equal
pg_catalog | ~>~ | character | character | boolean | greater than
pg_catalog | ~>~ | text | text | boolean | greater than
pg_catalog | ~~ | bytea | bytea | boolean | matches LIKE expression
pg_catalog | ~~ | character | text | boolean | matches LIKE expression
pg_catalog | ~~ | name | text | boolean | matches LIKE expression
pg_catalog | ~~ | text | text | boolean | matches LIKE expression
(12 rows)
तीसरी और चौथी पंक्तियां ऑपरेटर है जिसे मैं ढूंढ रहा हूं, लेकिन desc ription मेरे लिए थोड़ा अपर्याप्त है।
इस ऑपरेटर देखने के लिए Postgres द्वारा किया जा रहा है अगर तुम opclass साथ एक सूचकांक है। http://www.postgresql.org/docs/9.5/static/indexes-opclass.html –
'test (name text_pattern_ops) 'पर एक अनुक्रमणिका बनाएं और' नाम LIKE' abc% 'के लिए' EXPLAIN' आउटपुट देखें ' –