|
1 | 1 | /*
|
2 |
| - * Licensed to the Apache Software Foundation (ASF) under one |
3 |
| - * or more contributor license agreements. See the NOTICE file |
4 |
| - * distributed with this work for additional information |
5 |
| - * regarding copyright ownership. The ASF licenses this file |
6 |
| - * to you under the Apache License, Version 2.0 (the |
7 |
| - * "License"); you may not use this file except in compliance |
8 |
| - * with the License. You may obtain a copy of the License at |
| 2 | + * Copyright (C) 2023-2024 PostGraphDB |
9 | 3 | *
|
10 |
| - * http://www.apache.org/licenses/LICENSE-2.0 |
| 4 | + * This program is free software: you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU Affero General Public License as |
| 6 | + * published by the Free Software Foundation, either version 3 of the |
| 7 | + * License, or (at your option) any later version. |
11 | 8 | *
|
12 |
| - * Unless required by applicable law or agreed to in writing, |
13 |
| - * software distributed under the License is distributed on an |
14 |
| - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
15 |
| - * KIND, either express or implied. See the License for the |
16 |
| - * specific language governing permissions and limitations |
17 |
| - * under the License. |
18 |
| - */ |
| 9 | + * This program is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU Affero General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU Affero General Public License |
| 15 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 16 | + * |
| 17 | + * Portions Copyright (c) 2020-2023, Apache Software Foundation |
| 18 | + * Portions Copyright (c) 2019-2020, Bitnine Global |
| 19 | + */ |
19 | 20 | LOAD 'postgraph';
|
20 |
| -SET search_path TO postgraph; |
21 |
| -SELECT create_graph('order_by'); |
| 21 | +CREATE GRAPH order_by; |
22 | 22 | NOTICE: graph "order_by" has been created
|
23 | 23 | create_graph
|
24 | 24 | --------------
|
25 | 25 |
|
26 | 26 | (1 row)
|
27 | 27 |
|
28 |
| -SELECT * FROM cypher('order_by', $$CREATE ()$$) AS (result gtype); |
29 |
| - result |
30 |
| --------- |
31 |
| -(0 rows) |
| 28 | +USE GRAPH order_by; |
| 29 | + use_graph |
| 30 | +----------- |
| 31 | + |
| 32 | +(1 row) |
32 | 33 |
|
33 |
| -SELECT * FROM cypher('order_by', $$CREATE ({i: '1', j: 1})$$) AS (result gtype); |
34 |
| - result |
35 |
| --------- |
| 34 | +CREATE (); |
| 35 | +-- |
36 | 36 | (0 rows)
|
37 | 37 |
|
38 |
| -SELECT * FROM cypher('order_by', $$CREATE ({i: 1})$$) AS (result gtype); |
39 |
| - result |
40 |
| --------- |
| 38 | +CREATE ({i: '1', j: 1}); |
| 39 | +-- |
41 | 40 | (0 rows)
|
42 | 41 |
|
43 |
| -SELECT * FROM cypher('order_by', $$CREATE ({i: 1.0})$$) AS (result gtype); |
44 |
| - result |
45 |
| --------- |
| 42 | +CREATE ({i: 1}); |
| 43 | +-- |
46 | 44 | (0 rows)
|
47 | 45 |
|
48 |
| -SELECT * FROM cypher('order_by', $$CREATE ({i: 1::numeric})$$) AS (result gtype); |
49 |
| - result |
50 |
| --------- |
| 46 | +CREATE ({i: 1.0}); |
| 47 | +-- |
51 | 48 | (0 rows)
|
52 | 49 |
|
53 |
| -SELECT * FROM cypher('order_by', $$CREATE ({i: true})$$) AS (result gtype); |
54 |
| - result |
55 |
| --------- |
| 50 | +CREATE ({i: 1::numeric}); |
| 51 | +-- |
56 | 52 | (0 rows)
|
57 | 53 |
|
58 |
| -SELECT * FROM cypher('order_by', $$CREATE ({i: false})$$) AS (result gtype); |
59 |
| - result |
60 |
| --------- |
| 54 | +CREATE ({i: true}); |
| 55 | +-- |
61 | 56 | (0 rows)
|
62 | 57 |
|
63 |
| -SELECT * FROM cypher('order_by', $$CREATE ({i: {key: 'value'}})$$) AS (result gtype); |
64 |
| - result |
65 |
| --------- |
| 58 | +CREATE ({i: false}); |
| 59 | +-- |
66 | 60 | (0 rows)
|
67 | 61 |
|
68 |
| -SELECT * FROM cypher('order_by', $$CREATE ({i: [1]})$$) AS (result gtype); |
69 |
| - result |
70 |
| --------- |
| 62 | +CREATE ({i: {key: 'value'}}); |
| 63 | +-- |
71 | 64 | (0 rows)
|
72 | 65 |
|
73 |
| -SELECT * FROM cypher('order_by', $$ |
74 |
| - MATCH (u) |
75 |
| - RETURN u.i |
76 |
| - ORDER BY u.i |
77 |
| -$$) AS (i gtype); |
78 |
| - i |
79 |
| ------------------- |
80 |
| - {"key": "value"} |
81 |
| - [1] |
82 |
| - "1" |
83 |
| - false |
84 |
| - true |
85 |
| - 1::numeric |
86 |
| - 1 |
87 |
| - 1.0 |
88 |
| - |
89 |
| -(9 rows) |
90 |
| - |
91 |
| -SELECT * FROM cypher('order_by', $$ |
92 |
| - MATCH (u) |
93 |
| - RETURN u.i |
94 |
| - ORDER BY u.i DESC |
95 |
| -$$) AS (i gtype); |
96 |
| - i |
97 |
| ------------------- |
98 |
| - |
99 |
| - 1 |
100 |
| - 1.0 |
101 |
| - 1::numeric |
102 |
| - true |
103 |
| - false |
104 |
| - "1" |
105 |
| - [1] |
106 |
| - {"key": "value"} |
107 |
| -(9 rows) |
108 |
| - |
109 |
| -SELECT * FROM cypher('order_by', $$ |
110 |
| - MATCH (x) |
111 |
| - RETURN x.j ORDER BY x.j NULLS FIRST |
112 |
| -$$) AS (j gtype); |
113 |
| - j |
114 |
| ---- |
115 |
| - |
116 |
| - |
117 |
| - |
118 |
| - |
119 |
| - |
120 |
| - |
121 |
| - |
122 |
| - |
123 |
| - 1 |
124 |
| -(9 rows) |
125 |
| - |
126 |
| -SELECT * FROM cypher('order_by', $$ |
127 |
| - MATCH (x) |
128 |
| - RETURN x.j ORDER BY x.j NULLS LAST |
129 |
| -$$) AS (j gtype); |
130 |
| - j |
131 |
| ---- |
132 |
| - 1 |
133 |
| - |
134 |
| - |
135 |
| - |
136 |
| - |
137 |
| - |
138 |
| - |
139 |
| - |
140 |
| - |
141 |
| -(9 rows) |
142 |
| - |
143 |
| -SELECT * FROM cypher('order_by', $$ |
144 |
| - MATCH (x) |
145 |
| - RETURN x.i ORDER BY x.i USING < |
146 |
| -$$) AS (i gtype); |
147 |
| - i |
148 |
| ------------------- |
149 |
| - {"key": "value"} |
150 |
| - [1] |
151 |
| - "1" |
152 |
| - false |
153 |
| - true |
154 |
| - 1::numeric |
155 |
| - 1 |
156 |
| - 1.0 |
157 |
| - |
158 |
| -(9 rows) |
| 66 | +CREATE ({i: [1]}); |
| 67 | +-- |
| 68 | +(0 rows) |
159 | 69 |
|
160 |
| -SELECT drop_graph('order_by', true); |
| 70 | +MATCH (u) RETURN u.i ORDER BY u.i; |
| 71 | +ERROR: operator does not exist: postgraph.vertex -> postgraph.gtype |
| 72 | +HINT: No operator matches the given name and argument types. You might need to add explicit type casts. |
| 73 | +MATCH (u) RETURN u.i ORDER BY u.i DESC; |
| 74 | +ERROR: operator does not exist: postgraph.vertex -> postgraph.gtype |
| 75 | +HINT: No operator matches the given name and argument types. You might need to add explicit type casts. |
| 76 | +MATCH (u) RETURN u.i ORDER BY u.i ASC; |
| 77 | +ERROR: operator does not exist: postgraph.vertex -> postgraph.gtype |
| 78 | +HINT: No operator matches the given name and argument types. You might need to add explicit type casts. |
| 79 | +MATCH (x) RETURN x.j ORDER BY x.j NULLS FIRST; |
| 80 | +ERROR: operator does not exist: postgraph.vertex -> postgraph.gtype |
| 81 | +HINT: No operator matches the given name and argument types. You might need to add explicit type casts. |
| 82 | +MATCH (x) RETURN x.j ORDER BY x.j NULLS LAST; |
| 83 | +ERROR: operator does not exist: postgraph.vertex -> postgraph.gtype |
| 84 | +HINT: No operator matches the given name and argument types. You might need to add explicit type casts. |
| 85 | +MATCH (x) RETURN x.i ORDER BY x.i USING <; |
| 86 | +ERROR: operator does not exist: postgraph.vertex -> postgraph.gtype |
| 87 | +HINT: No operator matches the given name and argument types. You might need to add explicit type casts. |
| 88 | +DROP GRAPH order_by CASCADE; |
161 | 89 | NOTICE: drop cascades to 2 other objects
|
162 | 90 | DETAIL: drop cascades to table order_by._ag_label_vertex
|
163 | 91 | drop cascades to table order_by._ag_label_edge
|
|
0 commit comments