@@ -16,7 +16,7 @@ AS $function$
16
16
Builds a sql string that, if executed, creates a prepared statement to
17
17
tests retrive a row from *entity* by its primary key columns.
18
18
Example
19
- select realtime.build_prepared_statement_sql('public.notes', '{" id "}'::text[], '{" bigint "}'::text[])
19
+ select realtime.build_prepared_statement_sql('public.notes', '{\ " id\ " }'::text[], '{\ " bigint\ " }'::text[])
20
20
*/
21
21
select
22
22
'prepare ' || prepared_statement_name || ' as
@@ -40,10 +40,10 @@ $function$;
40
40
-- cast function
41
41
42
42
CREATE OR REPLACE FUNCTION realtime.\" cast\" (val text, type_ regtype)
43
- RETURNS jsonb
44
- LANGUAGE plpgsql
45
- SET search_path = ''
46
- IMMUTABLE
43
+ RETURNS jsonb
44
+ LANGUAGE plpgsql
45
+ SET search_path = ''
46
+ IMMUTABLE
47
47
AS $function$
48
48
declare
49
49
res jsonb;
@@ -56,21 +56,21 @@ $function$;
56
56
-- channel_name function
57
57
58
58
CREATE OR REPLACE FUNCTION realtime.channel_name()
59
- RETURNS text
60
- SET search_path = ''
61
- LANGUAGE sql
62
- STABLE
59
+ RETURNS text
60
+ SET search_path = ''
61
+ LANGUAGE sql
62
+ STABLE
63
63
AS $function$
64
64
select nullif(pg_catalog.current_setting('realtime.channel_name', true), '')::text;
65
65
$function$;
66
66
67
67
-- check_equality_op function
68
68
69
69
CREATE OR REPLACE FUNCTION realtime.check_equality_op(op realtime.equality_op, type_ regtype, val_1 text, val_2 text)
70
- RETURNS boolean
71
- LANGUAGE plpgsql
70
+ RETURNS boolean
71
+ LANGUAGE plpgsql
72
72
SET search_path = ''
73
- IMMUTABLE
73
+ IMMUTABLE
74
74
AS $function$
75
75
/*
76
76
Casts *val_1* and *val_2* as type *type_* and check the *op* condition for truthiness
@@ -141,10 +141,10 @@ $function$;
141
141
142
142
-- quote_wal2json function
143
143
CREATE OR REPLACE FUNCTION realtime.list_changes(publication name, slot_name name, max_changes integer, max_record_bytes integer)
144
- RETURNS SETOF realtime.wal_rls
145
- LANGUAGE sql
146
- SET search_path = ''
147
- SET log_min_messages TO 'fatal'
144
+ RETURNS SETOF realtime.wal_rls
145
+ LANGUAGE sql
146
+ SET search_path = ''
147
+ SET log_min_messages TO 'fatal'
148
148
AS $function$
149
149
with pub as (
150
150
select
@@ -216,21 +216,21 @@ AS $function$
216
216
select pg_catalog.string_agg('' || ch,'')
217
217
from pg_catalog.unnest(pg_catalog.string_to_array(nsp.nspname::text, null)) with ordinality x(ch, idx)
218
218
where
219
- not (x.idx = 1 and x.ch = '" ')
219
+ not (x.idx = 1 and x.ch = '\ " ')
220
220
and not (
221
221
x.idx = pg_catalog.array_length(pg_catalog.string_to_array(nsp.nspname::text, null), 1)
222
- and x . ch = '"'
222
+ and x.ch = '\ " '
223
223
)
224
224
)
225
225
|| '.'
226
226
|| (
227
227
select string_agg('' || ch,'')
228
228
from pg_catalog.unnest(pg_catalog.string_to_array(pc.relname::text, null)) with ordinality x(ch, idx)
229
229
where
230
- not ( x . idx = 1 and x . ch = '"' )
230
+ not (x.idx = 1 and x.ch = '\ " ')
231
231
and not (
232
232
x.idx = pg_catalog.array_length(pg_catalog.string_to_array(nsp.nspname::text, null), 1)
233
- and x . ch = '"'
233
+ and x.ch = '\ " '
234
234
)
235
235
)
236
236
from
0 commit comments