I have a issue when I try to insert into users table.
DO $$
DECLARE newId bigint;
BEGIN
INSERT INTO users("email","bio","status","created_by","updated_by")
VALUES ('[email protected]','❄❄Haocute$$','accepted','1','1')
RETURNING id INTO newId;
UPDATE synces SET "version" = "version" + 1, updated_at = now(),
new_id = newId WHERE "old_id" = 98525 and table_name = 'users';
IF NOT FOUND THEN
INSERT INTO synces
(created_at, updated_at, deleted_at, table_name, old_id, new_id, "version")
VALUES(now(), now(), null, 'users', 98525, newId, 0);
END IF;
END $$
Thank you for reading my post.
2
Answers
I found a solution
There are two possibilities:
use different custom string separator:
You can use extended strings with escaped values: