def lang_exists(cursor, lang):
 query = ("SELECT lanname FROM pg_language WHERE lanname='%s'" % lang)
 cursor.execute(query)
 return (cursor.rowcount > 0)

def lang_exists ( cursor , lang ) : query = ( "SELECT lanname FROM pg_language WHERE lanname='%s'" % lang ) cursor . execute ( query ) return ( cursor . rowcount > 0 )
checks if language exists for db .