You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nix/tests/expected/pgmq_data_api_wrapper.out
+63-63Lines changed: 63 additions & 63 deletions
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ alter role authenticated set statement_timeout = '8s';
55
55
*/
56
56
create schema if not exists queues_public;
57
57
grant usage on schema queues_public to postgres, anon, authenticated, service_role;
58
-
create or replace function queues_public.pop(
58
+
create or replace function queues_public.queue_pop(
59
59
queue_name text
60
60
)
61
61
returns setof pgmq.message_record
@@ -70,8 +70,8 @@ begin
70
70
);
71
71
end;
72
72
$$;
73
-
comment on function queues_public.pop(queue_name text) is 'Retrieves and locks the next message from the specified queue.';
74
-
create or replace function queues_public.send(
73
+
comment on function queues_public.queue_pop(queue_name text) is 'Retrieves and locks the next message from the specified queue.';
74
+
create or replace function queues_public.queue_send(
75
75
queue_name text,
76
76
message jsonb,
77
77
sleep_seconds integer default 0 -- renamed from 'delay'
@@ -90,8 +90,8 @@ begin
90
90
);
91
91
end;
92
92
$$;
93
-
comment on function queues_public.send(queue_name text, message jsonb, sleep_seconds integer) is 'Sends a message to the specified queue, optionally delaying its availability by a number of seconds.';
94
-
create or replace function queues_public.send_batch(
93
+
comment on function queues_public.queue_send(queue_name text, message jsonb, sleep_seconds integer) is 'Sends a message to the specified queue, optionally delaying its availability by a number of seconds.';
94
+
create or replace function queues_public.queue_send_batch(
95
95
queue_name text,
96
96
messages jsonb[],
97
97
sleep_seconds integer default 0 -- renamed from 'delay'
@@ -110,8 +110,8 @@ begin
110
110
);
111
111
end;
112
112
$$;
113
-
comment on function queues_public.send_batch(queue_name text, messages jsonb[], sleep_seconds integer) is 'Sends a batch of messages to the specified queue, optionally delaying their availability by a number of seconds.';
114
-
create or replace function queues_public.archive(
113
+
comment on function queues_public.queue_send_batch(queue_name text, messages jsonb[], sleep_seconds integer) is 'Sends a batch of messages to the specified queue, optionally delaying their availability by a number of seconds.';
114
+
create or replace function queues_public.queue_archive(
115
115
queue_name text,
116
116
message_id bigint
117
117
)
@@ -127,8 +127,8 @@ begin
127
127
);
128
128
end;
129
129
$$;
130
-
comment on function queues_public.archive(queue_name text, message_id bigint) is 'Archives a message by moving it from the queue to a permanent archive.';
131
-
create or replace function queues_public.archive(
130
+
comment on function queues_public.queue_archive(queue_name text, message_id bigint) is 'Archives a message by moving it from the queue to a permanent archive.';
131
+
create or replace function queues_public.queue_archive(
132
132
queue_name text,
133
133
message_id bigint
134
134
)
@@ -144,8 +144,8 @@ begin
144
144
);
145
145
end;
146
146
$$;
147
-
comment on function queues_public.archive(queue_name text, message_id bigint) is 'Archives a message by moving it from the queue to a permanent archive.';
148
-
create or replace function queues_public.delete(
147
+
comment on function queues_public.queue_archive(queue_name text, message_id bigint) is 'Archives a message by moving it from the queue to a permanent archive.';
148
+
create or replace function queues_public.queue_delete(
149
149
queue_name text,
150
150
message_id bigint
151
151
)
@@ -161,8 +161,8 @@ begin
161
161
);
162
162
end;
163
163
$$;
164
-
comment on function queues_public.delete(queue_name text, message_id bigint) is 'Permanently deletes a message from the specified queue.';
165
-
create or replace function queues_public.read(
164
+
comment on function queues_public.queue_delete(queue_name text, message_id bigint) is 'Permanently deletes a message from the specified queue.';
165
+
create or replace function queues_public.queue_read(
166
166
queue_name text,
167
167
sleep_seconds integer,
168
168
n integer
@@ -181,19 +181,19 @@ begin
181
181
);
182
182
end;
183
183
$$;
184
-
comment on function queues_public.read(queue_name text, sleep_seconds integer, n integer) is 'Reads up to "n" messages from the specified queue with an optional "sleep_seconds" (visibility timeout).';
184
+
comment on function queues_public.queue_read(queue_name text, sleep_seconds integer, n integer) is 'Reads up to "n" messages from the specified queue with an optional "sleep_seconds" (visibility timeout).';
185
185
-- Grant execute permissions on wrapper functions to roles
186
-
grant execute on function queues_public.pop(text) to postgres, service_role, anon, authenticated;
186
+
grant execute on function queues_public.queue_pop(text) to postgres, service_role, anon, authenticated;
187
187
grant execute on function pgmq.pop(text) to postgres, service_role, anon, authenticated;
188
-
grant execute on function queues_public.send(text, jsonb, integer) to postgres, service_role, anon, authenticated;
188
+
grant execute on function queues_public.queue_send(text, jsonb, integer) to postgres, service_role, anon, authenticated;
189
189
grant execute on function pgmq.send(text, jsonb, integer) to postgres, service_role, anon, authenticated;
190
-
grant execute on function queues_public.send_batch(text, jsonb[], integer) to postgres, service_role, anon, authenticated;
190
+
grant execute on function queues_public.queue_send_batch(text, jsonb[], integer) to postgres, service_role, anon, authenticated;
191
191
grant execute on function pgmq.send_batch(text, jsonb[], integer) to postgres, service_role, anon, authenticated;
192
-
grant execute on function queues_public.archive(text, bigint) to postgres, service_role, anon, authenticated;
192
+
grant execute on function queues_public.queue_archive(text, bigint) to postgres, service_role, anon, authenticated;
193
193
grant execute on function pgmq.archive(text, bigint) to postgres, service_role, anon, authenticated;
194
-
grant execute on function queues_public.delete(text, bigint) to postgres, service_role, anon, authenticated;
194
+
grant execute on function queues_public.queue_delete(text, bigint) to postgres, service_role, anon, authenticated;
195
195
grant execute on function pgmq.delete(text, bigint) to postgres, service_role, anon, authenticated;
196
-
grant execute on function queues_public.read(text, integer, integer) to postgres, service_role, anon, authenticated;
196
+
grant execute on function queues_public.queue_read(text, integer, integer) to postgres, service_role, anon, authenticated;
197
197
grant execute on function pgmq.read(text, integer, integer, jsonb) to postgres, service_role, anon, authenticated;
198
198
ERROR: function pgmq.read(text, integer, integer, jsonb) does not exist
199
199
-- For the service role, we want full access
@@ -216,20 +216,20 @@ select pgmq.create('baz');
216
216
begin;
217
217
set local role service_role;
218
218
-- Should Succeed
219
-
select queues_public.send(
219
+
select queues_public.queue_send(
220
220
queue_name := 'baz',
221
221
message := '{}'
222
222
);
223
-
send
224
-
------
225
-
1
223
+
queue_send
224
+
------------
225
+
1
226
226
(1 row)
227
227
228
228
rollback;
229
229
begin;
230
230
set local role anon;
231
231
-- Should Fail
232
-
select queues_public.send(
232
+
select queues_public.queue_send(
233
233
queue_name := 'baz',
234
234
message := '{}'
235
235
);
@@ -246,12 +246,12 @@ SQL statement "select *
246
246
msg := message,
247
247
delay := sleep_seconds
248
248
)"
249
-
PL/pgSQL function queues_public.send(text,jsonb,integer) line 3 at RETURN QUERY
249
+
PL/pgSQL function queues_public.queue_send(text,jsonb,integer) line 3 at RETURN QUERY
250
250
rollback;
251
251
begin;
252
252
set local role authenticated;
253
253
-- Should Fail
254
-
select queues_public.send(
254
+
select queues_public.queue_send(
255
255
queue_name := 'baz',
256
256
message := '{}'
257
257
);
@@ -268,26 +268,26 @@ SQL statement "select *
268
268
msg := message,
269
269
delay := sleep_seconds
270
270
)"
271
-
PL/pgSQL function queues_public.send(text,jsonb,integer) line 3 at RETURN QUERY
271
+
PL/pgSQL function queues_public.queue_send(text,jsonb,integer) line 3 at RETURN QUERY
272
272
rollback;
273
273
-- service_role can read mesages, anon and authenticated can not
274
274
begin;
275
275
set local role service_role;
276
276
-- Should Succeed
277
-
select queues_public.read(
277
+
select queues_public.queue_read(
278
278
queue_name := 'baz',
279
279
sleep_seconds := 0,
280
280
n := 1
281
281
);
282
-
read
283
-
------
282
+
queue_read
283
+
------------
284
284
(0 rows)
285
285
286
286
rollback;
287
287
begin;
288
288
set local role anon;
289
289
-- Should Fail
290
-
select queues_public.read(
290
+
select queues_public.queue_read(
291
291
queue_name := 'baz',
292
292
sleep_seconds := 0,
293
293
n := 1
@@ -318,12 +318,12 @@ SQL statement "select *
318
318
vt := sleep_seconds,
319
319
qty := n
320
320
)"
321
-
PL/pgSQL function queues_public.read(text,integer,integer) line 3 at RETURN QUERY
321
+
PL/pgSQL function queues_public.queue_read(text,integer,integer) line 3 at RETURN QUERY
322
322
rollback;
323
323
begin;
324
324
set local role authenticated;
325
325
-- Should Fail
326
-
select queues_public.read(
326
+
select queues_public.queue_read(
327
327
queue_name := 'baz',
328
328
sleep_seconds := 0,
329
329
n := 1
@@ -354,7 +354,7 @@ SQL statement "select *
354
354
vt := sleep_seconds,
355
355
qty := n
356
356
)"
357
-
PL/pgSQL function queues_public.read(text,integer,integer) line 3 at RETURN QUERY
357
+
PL/pgSQL function queues_public.queue_read(text,integer,integer) line 3 at RETURN QUERY
0 commit comments