> > Or a "smart" view. Set a session variable before running the > > query and have the (one) view return the locale'd data based > > on the session variable ... > > > > set session "mika.current_locale" = 'locale@2_use'; > > > > and use > > > > select current_setting('mika.current_locale') > > > > as needed inside the view definition > > But the argument that follows COLLATE is an identifier, not a parameter, ah, true enough > so it must be hardcoded in the view, just like column names or table names. > I don't see how you could use the setting to control the COLLATE clause > through a view. The view might produce its rows by calling a function which in turn reads the setting and dynamically constructs and exexcutes the query needed to produce the locale-dependant rows, no ? =8-) Convoluted ? I guess so ... Karsten