Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

get last login date of users in confluence (postgres)


i want to get last login date of confluence users. try this but it return for some users "last update" or " last failed login date" instead of last login date.


any idea?


2 answers

1 accepted

0 votes
Answer accepted
WITH last_login_date AS
(SELECT user_id
      , to_timestamp(CAST(cua.attribute_value AS double precision)/1000) AS last_login
   FROM cwd_user_attribute cua
  WHERE cua.attribute_name = 'lastAuthenticated'
    AND to_timestamp(CAST(cua.attribute_value AS double precision)/1000) < (CURRENT_DATE))
SELECT c.user_name
     , li.successdate
     , g.group_name
  FROM cwd_user c
 INNER JOIN last_login_date l ON ( = l.user_id)
 INNER JOIN cwd_membership m  ON ( = m.child_user_id)
 INNER JOIN cwd_group g       ON (m.parent_id =
 INNER JOIN user_mapping um ON (c.user_name = um.username)
 INNER JOIN logininfo li ON (um.user_key = li.username)
 WHERE g.group_name LIKE 'CEO-%' ;

@me  The link you specified above this answer indicates you must specify a timeframe.  How is that done?  Thank you for any help in advance!

0 votes
Fadoua Community Leader Jul 17, 2021


Are you using Postgres or SQL?

Because on your title it says Postgres but for the tags you selected SQL




@Fadoua any update?

Fadoua Community Leader Jul 20, 2021

@me I am still looking 

Fadoua Community Leader Jul 22, 2021

@me I checked every single document online. The only one I found is the same one you shared. You will need to specify the timeframe interval

Best of luck!


Suggest an answer

Log in or Sign up to answer

Atlassian Community Events