-
Notifications
You must be signed in to change notification settings - Fork 4
LkbLexDbSingleUser
[see lkb/lexdb/README.single-user]
$ export MyLexDB=erg
$ createdb $MyLexDB
[NOW edit SQL script file 'su-init.sql' to specify the LexDB fields]
$ psql $MyLexDB
=> \i su-init.sql
[now load the field mappings...]
=> \copy dfn from lexdb.dfn
=> \q
[NOW load your grammar, as normal, in the LKB] [then open a connection to the empty LexDB...]
LKB(): (initialize-lexdb :type :single-user :dbname "MYLEXDB")
[and export you lexicon to dump files for the database...]
LKB(): (export-lexicon)
[import the dump file into the database...] [NOTE: encoding of lexicon/dump files must be UTF-8]
$ psql $MyLexDB
=> \copy lex from /home/bmw20/tmp/LinGO.rev
LKB->Set Options->*LEXDB-PARAMS* = ((:dbname "MYLEXDB") (:type :single-user))
[NOW reload grammar in LKB, and you should see a messages similar to the following:
...
(LexDB) connected to LexDB erg2@localhost:5432 as database user bmw20
(LexDB) total 'lex' entries available: 23055
...
]
[now we initialize the table of orthography keys...]
LKB(): (new-lex-key-table *lexicon*)
[and the database SEMI...]
LKB(): (new-semi *lexicon*)
THAT'S IT
Description:
- - lexicon entries should be made available in 'lex' (which can be a
table or a view) - the mapping from database fields into AVM
path-values in specified in 'dfn' - a table 'lex_key' is generated
by '(new-lex-key-table *lexicon*)' and is used for lexicon
lookup - a number of tables (and a view) 'semi_*' are generated by
'(new-semi *lexicon*)' and store the database object SEMI - you
are responsible for ensuring that there exists an appropriate index
on the 'name' field of 'lex' (or things will run slow...) - you are
free to define 'lex' as a view (eg. you could store a large number
of lexicon entries in another table 'all_entries', create a table
'active'to specify which entry 'name's you want in view, then define
'lex' as:
- CREATE VIEW lex AS active JOIN all_entries USING name;
-
[http://www.postgresql.org/download/ PostgreSQL server] version 8.0 or above must be running either on the local machine or remotely over a TCP/IP port.
-
Create user accounts.
-
Configure access privileges.
-
By default the server will run on port 5432. To use another port set the PSQL [http://www.postgresql.org/docs/7.4/interactive/libpq-envars.html environment variable] PGPORT.
-
Restart PostgreSQL server.
-
Ensure there exists a database user postgres with superuser privileges.
-
As the database superuser, create a user account for yourself (substitute your shell login for USERNAME below):
- {{{ $ createuser -U postgres --createdb --no-adduser USERNAME
CREATE USER}}}
- [Optional] If you wish to use password authentication add the -P option.
-
Ensure the [http://www.postgresql.org/docs/8.1/interactive/client-authentication.html#AUTH-PG-HBA-CONF access privilege configuration file] pg_hba.conf is set appropriately. E.g.
- {{{# TYPE DATABASE USER CIDR-ADDRESS METHOD
local all all trust host all all 127.0.0.1/32 trust host all all ::1/128 trust}}}
- [Optional] If you wish to use password authentication replace trust with md5.
-
Allow remote access to the server by adding lines of the following form to your pg_hba.conf file (replace IP_ADDRESS with the actual numbers):
-
host all all IP_ADDRESS/32 md5
-
It is advisable to require password authentication (ie. md5 instead of trust) for remote access.
-
- On a PostgreSQL 8 server, remote machines will not be able to connect unless you modify listen_addresses in the postgresql.conf file. (The value takes the form of a comma-separated list of host names and/or numeric IP addresses.)
TODO:
- generics [?]
- encoding [y]
- *lexicon* default [n]
- psql-quote-literal / with-lexdb-locale [y]
- Emacs interface
* cle-check-pg-interface-version
Home | Forum | Discussions | Events