Closed GoogleCodeExporter closed 9 years ago
See http://www.postgresql.org/docs/8.2/static/ddl-schemas.html on the use of
schemas.
Original comment by jjhel...@gmail.com
on 20 Feb 2008 at 9:20
What to do:
- Create a schema for nurpawiki
- nurpawiki schema is used for the wiki data and created for both 8.2 and 8.3+.
The
search path will be set so that nurpawiki code doesn't need to change.
- For Postgresql 8.2 and earlier, load tsearch2.sql will be loaded into the
public
schema, thus making it easier to export only nurpawiki data for backups and
migrations.
Create new SQL scripts:
- nurpawiki_psql-8.2.sql -- use for earlier installations
- nurpawiki.sql -- for newer
The contents of nurpawiki_psql-8.2.sql would look something like this:
8<
\i tsearch2.sql
\i nurpawiki.sql -- creates nurpawiki schema and sets it current
8<
nurpawiki.sql could be used as-is on Postgresql 8.3 and later.
Original comment by jjhel...@gmail.com
on 21 Feb 2008 at 11:16
First stab at this in r364. The change is actually quite a bit more
complicated than
what's said above.
Ended up not using search_path for 'nw' schema. Instead all DB ops are just
prefixed
with nw.
The changes creates a new schema version and moves all the DB tables under the
new
'nw' schema.
As Postgresql 8.2 and 8.3 have different names for some of the tsearch2
functions,
the DB upgrade code needs to dynamically adapt to different versions by renaming
those functions depending on what it finds from pg_proc table.
Original comment by jjhel...@gmail.com
on 22 Feb 2008 at 9:09
Done. See changes between r364-r380.
Original comment by jjhel...@gmail.com
on 23 Feb 2008 at 9:42
Original issue reported on code.google.com by
jjhel...@gmail.com
on 20 Feb 2008 at 9:18