how do I use recursive query?

i have the following structure :
dir
id : int8, primary key
name : text
parent_dir : int8 references dir(id)

how do I get all parent directories from a directory?
Was this page helpful?