syscat.source_escaping.diff
application/octet-stream
Filename: syscat.source_escaping.diff
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/tutorial/syscat.source | 0 | 0 |
diff --git a/src/tutorial/syscat.source b/src/tutorial/syscat.source
new file mode 100644
index 15d58f3..fd9ca6c
*** a/src/tutorial/syscat.source
--- b/src/tutorial/syscat.source
***************
*** 17,22 ****
--- 17,26 ----
--
SET SEARCH_PATH TO pg_catalog;
+ -- The LIKE syntax requires underscores to be escaped, so make
+ -- sure we are doing so properly.
+ SET standard_conforming_strings TO on;
+
--
-- lists the names of all database owners and the name of their database(s)
--
*************** SELECT n.nspname, c.relname
*** 32,38 ****
FROM pg_class c, pg_namespace n
WHERE c.relnamespace=n.oid
and c.relkind = 'r' -- not indices, views, etc
! and n.nspname not like 'pg\\_%' -- not catalogs
and n.nspname != 'information_schema' -- not information_schema
ORDER BY nspname, relname;
--- 36,42 ----
FROM pg_class c, pg_namespace n
WHERE c.relnamespace=n.oid
and c.relkind = 'r' -- not indices, views, etc
! and n.nspname not like 'pg\_%' -- not catalogs
and n.nspname != 'information_schema' -- not information_schema
ORDER BY nspname, relname;
*************** SELECT n.nspname, c.relname, a.attname,
*** 68,74 ****
pg_attribute a, pg_type t
WHERE n.oid = c.relnamespace
and c.relkind = 'r' -- no indices
! and n.nspname not like 'pg\\_%' -- no catalogs
and n.nspname != 'information_schema' -- no information_schema
and a.attnum > 0 -- no system att's
and not a.attisdropped -- no dropped columns
--- 72,78 ----
pg_attribute a, pg_type t
WHERE n.oid = c.relnamespace
and c.relkind = 'r' -- no indices
! and n.nspname not like 'pg\_%' -- no catalogs
and n.nspname != 'information_schema' -- no information_schema
and a.attnum > 0 -- no system att's
and not a.attisdropped -- no dropped columns
*************** SELECT n.nspname, r.rolname, format_type
*** 86,92 ****
and t.typnamespace = n.oid
and t.typrelid = 0 -- no complex types
and t.typelem = 0 -- no arrays
! and n.nspname not like 'pg\\_%' -- no built-in types
and n.nspname != 'information_schema' -- no information_schema
ORDER BY nspname, rolname, typname;
--- 90,96 ----
and t.typnamespace = n.oid
and t.typrelid = 0 -- no complex types
and t.typelem = 0 -- no arrays
! and n.nspname not like 'pg\_%' -- no built-in types
and n.nspname != 'information_schema' -- no information_schema
ORDER BY nspname, rolname, typname;
*************** SELECT n.nspname, p.proname, p.pronargs,
*** 145,151 ****
FROM pg_namespace n, pg_proc p,
pg_language l, pg_type t
WHERE p.pronamespace = n.oid
! and n.nspname not like 'pg\\_%' -- no catalogs
and n.nspname != 'information_schema' -- no information_schema
and p.prolang = l.oid
and p.prorettype = t.oid
--- 149,155 ----
FROM pg_namespace n, pg_proc p,
pg_language l, pg_type t
WHERE p.pronamespace = n.oid
! and n.nspname not like 'pg\_%' -- no catalogs
and n.nspname != 'information_schema' -- no information_schema
and p.prolang = l.oid
and p.prorettype = t.oid
*************** SELECT am.amname, n.nspname, opf.opfname
*** 179,184 ****
ORDER BY nspname, amname, opfname, oprname;
--
! -- Reset the search path
--
RESET SEARCH_PATH;
--- 183,190 ----
ORDER BY nspname, amname, opfname, oprname;
--
! -- Reset the search path and standard_conforming_strings
--
RESET SEARCH_PATH;
+ RESET standard_conforming_strings;
+