diff --git a/docs/postgresql.md b/docs/postgresql.md index 6fdd73a..4b5e7e7 100644 --- a/docs/postgresql.md +++ b/docs/postgresql.md @@ -108,6 +108,17 @@ order the files are read in. - SQL identifier delimiters are removed for the parsed model, so the table `"user data"` is modeled as `user data` and the column `"user id"` is modeled as `user id`. +- sqlcj models one namespace, so an unqualified and a `public`-qualified name + are the same name: `users`, `public.users`, and `"public"."users"` are one + table, and `mood`, `public.mood`, and `"public"."mood"` are one type. A schema + qualifier is compared without its SQL identifier delimiters and + case-insensitively, as every other name is. +- A table or a type qualified with any other schema is invisible: sqlcj never + models it, every statement whose own table or type stands there is ignored + before anything it names is resolved, and a query that names such a table is + rejected as an unknown table. `search_path` is not followed, so an + unqualified name always belongs to the one namespace sqlcj models, whatever a + `SET search_path` statement in the snapshot says. ## Supported Column Types @@ -137,7 +148,7 @@ accepted and map exactly like their unparameterized spellings. | `BYTEA` | `byte[]` | A record compares an array component by reference, so two row records holding equal bytes are not `equals`. | | `JSON` | `String` | The JSON text itself. PostgreSQL stores it as written, so it reads back exactly as written. sqlcj never parses, validates, or normalizes it. | | `JSONB` | `String` | The JSON text itself. PostgreSQL stores a decomposed value, so the text reads back as PostgreSQL renders it rather than as written, and `=` compares by value. sqlcj never parses, validates, or normalizes it. | -| The name of an enum type the schema declares | The generated Java enum of that type | Matched without SQL identifier delimiters and case-insensitively, as PostgreSQL resolves an unquoted type name. See [Enum Types](#enum-types). | +| The name of an enum type the schema declares | The generated Java enum of that type | Matched without SQL identifier delimiters and case-insensitively, as PostgreSQL resolves an unquoted type name. A `public`-qualified name resolves as its unqualified name, so `public.mood` and `"public"."mood"` are the type `mood`, and a name qualified with any other schema never resolves. See [Enum Types](#enum-types). | | A one-dimensional array of any spelling above except `BYTEA`, `JSON`, and `JSONB`, written `type[]` or `type[n]` | `java.util.List` of the element's Java type | The declared size is ignored, as PostgreSQL ignores it. See [Array Types](#array-types). | Any spelling that is not listed above has no Java mapping. Such a column is @@ -252,23 +263,29 @@ left: | `ALTER TYPE ... RENAME VALUE '