word: restrict by priority level
[sheet.git] / tools / word.pg.sql
index 22ff113cc86d1c5a8850ad33a5f188392017e6f0..1dc4f5bc68c8b3ed107967e6c69b9eaaa8a9d613 100644 (file)
@@ -25,7 +25,10 @@ COMMENT ON COLUMN word.thumb      IS 'ImageMagick convert options to create thum
 COMMENT ON COLUMN word.wptitle    IS 'reference Wikipedia article';
 
 CREATE OR REPLACE FUNCTION exportform(word) RETURNS text AS $$
-       SELECT (CASE WHEN $1.cover THEN '*' ELSE '' END) || array_to_string($1.form || $1.alt, '/');
+       SELECT concat(
+               $1.prio || CASE WHEN $1.cover THEN 'c' ELSE '' END || ':',
+               array_to_string($1.form || $1.alt, '/')
+       );
 $$ LANGUAGE SQL IMMUTABLE;
 
 CREATE OR REPLACE VIEW _cat_words AS