connection = PG::Connection.new(@db_hash)
- sql_query = '(SELECT username FROM prefs)'
- sql_query += 'UNION'
- sql_query += '(SELECT user_from FROM shared);'
+ # There's also an "owner" field in the "shares" table, but it
+ # contains a principal URL and not a bare username. Thus its
+ # format depends on the CalDAV server configuration, and isn't
+ # predictable.
+ sql_query = 'SELECT username FROM prefs'
begin
connection.query(sql_query) do |result|