Received: from gate.abas.de (gate.abas.de [194.121.23.3]) by hub.org (8.10.1/8.10.1) with ESMTP id e7F8hDn46146 for ; Tue, 15 Aug 2000 04:43:13 -0400 (EDT) Received: (from smap@localhost) by gate.abas.de (8.8.2/8.6.12) id KAA10414 for ; Tue, 15 Aug 2000 10:43:07 +0200 (MET DST) Received: from as.abas.de(192.168.0.3) by gate.abas.de via smap (V1.3) id sma010412; Tue Aug 15 10:43:07 2000 Received: from abas.de (agate.abas.de [192.168.0.2]) by as.abas.de (8.9.3/8.7.6/mh01) with ESMTP id KAA20945 for ; Tue, 15 Aug 2000 10:43:07 +0200 Message-ID: <3999029A.1E39AAAB@abas.de> Date: Tue, 15 Aug 2000 10:43:06 +0200 From: Volker Krebs Organization: Abas Software AG X-Mailer: Mozilla 4.72 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Language dependent fields Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200008/101 Hi, I want the content of a field to be language dependent. Therfore we have a Translation table which looks like this: tln_id tln_lng_id tln_text --------------------------------- 1 de hallo 1 en hello 2 de Herr 2 en Mister any language dependent fields reference to this table e.g. table customer cst_id cst_sometext_tln_id ---------------------------- 1000 1 I've created a view to get the text: CREATE VIEW locale_customer AS SELECT customer.*, tln_text, tln_lng_id FROM customer,translation WHERE tln_id=cst_sometext_tln_id; this works fine for tables with only one language dependent field. But if I have more than one field I've got a problem. e.g. table customer2 cst_id cst_sometext_tln_id cst_sometext2_tln_id ---------------------------------------------------- 1000 1 2 how can I create a proper view, to get both tln_text fields ?? CREATE VIEW locale_customer2 AS SELECT customer2.*, tln_text, tln_lng_id FROM customer,translation WHERE tln_id=cst_sometext_tln_id OR tln_id=cst_sometext2_tln_id; gives me all tln_text fields, but I can't distinguish between them. Any help appriciated. thanks Volker