I used available data from my PhD study database in a new independent post doc study. In this study, except for the raw data available, every other aspects are new (study design, hypotheses, analyses, and discussion). In sum, the source of data (sample and instruments) for this study was the same database I created during my PhD. The two studies are different, but because I used data from the PhD database, should I give authorship of this new study to my former thesis supervisor? Would this be a ghost/gift authorship, or a necessary action?
I don't think this case warrants authorship. Your advisor did nothing to contribute to the new work, helping you with a prior paper says nothing about future papers.
You should absolutely cite your thesis (or whatever paper used this dataset) in your new work, and make sure that the dataset is not protected in some way (say, if it's a clinical dataset that is restricted in use via an IRB you might not be able to use it).