Iter returns an iterator through the search path. We must include the implicit pg_catalog and temporary schema at the beginning of the search path, unless they have been explicitly set later by the user. We also include pg_extension in the path, as this normally be used in place of the public schema
()
| 132 | // first (even before pg_catalog)." |
| 133 | // - https://www.postgresql.org/docs/9.1/static/runtime-config-client.html |
| 134 | func (s SearchPath) Iter() SearchPathIter { |
| 135 | implicitPgTempSchema := !s.containsPgTempSchema && s.tempSchemaName != "" |
| 136 | sp := SearchPathIter{ |
| 137 | paths: s.paths, |
| 138 | implicitPgCatalog: !s.containsPgCatalog, |
| 139 | implicitPgExtension: !s.containsPgExtension, |
| 140 | implicitPgTempSchema: implicitPgTempSchema, |
| 141 | tempSchemaName: s.tempSchemaName, |
| 142 | } |
| 143 | return sp |
| 144 | } |
| 145 | |
| 146 | // IterWithoutImplicitPGSchemas is the same as Iter, but does not include the |
| 147 | // implicit pg_temp and pg_catalog. |