Skip to content

Commit c04df7d

Browse files
Remove reg* pseudotype columns; add object info functions (#17)
Drop the `reg*` pseudotype columns (`regclass`/`regconfig`/`regdictionary`/`regnamespace`/`regoperator`/`regprocedure`/`regtype`) from `_object_reference._object_oid` in favor of a single plain `oid` column (`object_oid`) and a plain `oid` `classid`, removing the now-unnecessary `count_nulls`-backed `null_count` trigger that used to arbitrate between them. - Drop the `count_nulls` dependency entirely (the search_path workaround DO block, `object_reference.control`'s `requires`, the Makefile install target, and test setup) — the trigger above was its only reason for being there. - Add `object_reference.object__describe()` / `object__identity()` (thin wrappers around `pg_describe_object()`/`pg_identify_object()`), and `object__cleanup()` (best-effort delete, ignoring `foreign_key_violation`), wired to a new `AFTER DELETE` trigger on `object_group__object` so removing an object from its last group auto-attempts cleanup. - `object__getsert`'s core (`_object_v__for_update`) now refuses to track objects living in a `pg_temp*`/`pg_toast_temp*` schema. - Test updates: `object_group.sql`'s scratch tables switch from `TEMP` to regular tables (temp objects are now rejected) plus new coverage for the cleanup trigger; `base.sql` swaps the now-moot count_nulls-relocation test for coverage of `object_oid`, `object__describe()`/`object__identity()`, and temp-object rejection. - `_object_reference._object_oid.object_oid` was later dropped too — it always equaled `objid` and never diverged.
1 parent 94a9272 commit c04df7d

14 files changed

Lines changed: 538 additions & 164 deletions

‎META.in.json‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"X_comment": "The pgxntool Makefile will strip out empty keys to produce a working META.json, so it's fine to leave them here.",
1010
"X_comment": "NOTE: Don't get too cute with reformatting this file... some of the processing against it doesn't use a full JSON parser",
1111
"X_comment": "",
12-
"X_comment": "I've tried to put things in a logical order. Comments welcome at https://github.com/decibel/pgxntool/issues!",
12+
"X_comment": "I've tried to put things in a logical order. Comments welcome at https://github.com/Postgres-Extensions/pgxntool/issues!",
1313

1414
"X_comment": "REQUIRED. Name of distribution.",
1515
"X_comment": "Note! Distribution names currently can't contain spaces.",
@@ -58,13 +58,13 @@
5858

5959
"X_comment": "Optional. \"resources\": Web resources available for this distribution. http://pgxn.org/spec/#resources",
6060
"resources": {
61-
"homepage": "http://github.com/decibel/object_reference/",
61+
"homepage": "http://github.com/Postgres-Extensions/object_reference/",
6262
"bugtracker": {
63-
"web": "http://github.com/decibel/object_reference/issues"
63+
"web": "http://github.com/Postgres-Extensions/object_reference/issues"
6464
},
6565
"repository": {
66-
"url": "git://github.com/decibel/object_reference.git",
67-
"web": "http://github.com/decibel/object_reference/",
66+
"url": "git://github.com/Postgres-Extensions/object_reference.git",
67+
"web": "http://github.com/Postgres-Extensions/object_reference/",
6868
"type": "git"
6969
}
7070
},
@@ -76,11 +76,12 @@
7676

7777
"build": {
7878
"requires": {
79-
"PostgreSQL": "9.5.0"
79+
"PostgreSQL": "12.0.0"
8080
}
8181
},
8282
"runtime": {
8383
"requires": {
84+
"cat_tools": 0,
8485
"plpgsql": 0
8586
}
8687
},
@@ -95,7 +96,7 @@
9596
"no_index": "",
9697

9798
"X_comment": "Unusual. Package/tool used to generate this file.",
98-
"generated_by": "pgxntool https://github.com/decibel/pgxntool",
99+
"generated_by": "pgxntool https://github.com/Postgres-Extensions/pgxntool",
99100

100101
"X_comment": "REQUIRED. Version info for this file. http://pgxn.org/spec/#meta-spec",
101102
"meta-spec": {

‎META.json‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"X_comment": "Keys marked REQUIRED or Optional are what you'd expect. Keys marked Unusual are keys you don't normally need to use.",
1010
"X_comment": "The pgxntool Makefile will strip out empty keys to produce a working META.json, so it's fine to leave them here.",
1111
"X_comment": "NOTE: Don't get too cute with reformatting this file... some of the processing against it doesn't use a full JSON parser",
12-
"X_comment": "I've tried to put things in a logical order. Comments welcome at https://github.com/decibel/pgxntool/issues!",
12+
"X_comment": "I've tried to put things in a logical order. Comments welcome at https://github.com/Postgres-Extensions/pgxntool/issues!",
1313

1414
"X_comment": "REQUIRED. Name of distribution.",
1515
"X_comment": "Note! Distribution names currently can't contain spaces.",
@@ -56,13 +56,13 @@
5656

5757
"X_comment": "Optional. \"resources\": Web resources available for this distribution. http://pgxn.org/spec/#resources",
5858
"resources": {
59-
"homepage": "http://github.com/decibel/object_reference/",
59+
"homepage": "http://github.com/Postgres-Extensions/object_reference/",
6060
"bugtracker": {
61-
"web": "http://github.com/decibel/object_reference/issues"
61+
"web": "http://github.com/Postgres-Extensions/object_reference/issues"
6262
},
6363
"repository": {
64-
"url": "git://github.com/decibel/object_reference.git",
65-
"web": "http://github.com/decibel/object_reference/",
64+
"url": "git://github.com/Postgres-Extensions/object_reference.git",
65+
"web": "http://github.com/Postgres-Extensions/object_reference/",
6666
"type": "git"
6767
}
6868
},
@@ -74,11 +74,12 @@
7474

7575
"build": {
7676
"requires": {
77-
"PostgreSQL": "9.5.0"
77+
"PostgreSQL": "12.0.0"
7878
}
7979
},
8080
"runtime": {
8181
"requires": {
82+
"cat_tools": 0,
8283
"plpgsql": 0
8384
}
8485
},
@@ -92,7 +93,7 @@
9293
"X_comment": "Unusual. \"no_index\": Files/directories that should not be indexed. http://pgxn.org/spec/#no_index",
9394

9495
"X_comment": "Unusual. Package/tool used to generate this file.",
95-
"generated_by": "pgxntool https://github.com/decibel/pgxntool",
96+
"generated_by": "pgxntool https://github.com/Postgres-Extensions/pgxntool",
9697

9798
"X_comment": "REQUIRED. Version info for this file. http://pgxn.org/spec/#meta-spec",
9899
"meta-spec": {

‎Makefile‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include pgxntool/base.mk
33
testdeps: $(wildcard test/*.sql test/helpers/*.sql) # Be careful not to include directories in this
44
testdeps: test_factory
55

6-
install: cat_tools count_nulls
6+
install: cat_tools
77

88
test: dump_test
99
extra_clean += $(wildcard test/dump/*.log)
@@ -15,11 +15,6 @@ cat_tools: $(DESTDIR)$(datadir)/extension/cat_tools.control
1515
$(DESTDIR)$(datadir)/extension/cat_tools.control:
1616
pgxn install --unstable cat_tools
1717

18-
.PHONY: count_nulls
19-
count_nulls: $(DESTDIR)$(datadir)/extension/count_nulls.control
20-
$(DESTDIR)$(datadir)/extension/count_nulls.control:
21-
pgxn install --unstable count_nulls
22-
2318
.PHONY: test_factory
2419
test_factory: $(DESTDIR)$(datadir)/extension/test_factory.control
2520
$(DESTDIR)$(datadir)/extension/test_factory.control:

0 commit comments

Comments
 (0)