Get list of canonical urls? I have a list of ~2500 pages that I need to get canonical urls for from an old D6 site.  The site uses Path_Redirect.

Using mysql queries I can get a list of nids for the pages I want, but I'm having trouble connecting the nids to the most current path alias.  Little help?
I'm running into this problem, though I'm not sure we're using Path Redirect. For me, Migrate is bringing in URLs that are non-canonical, and I need to override the query to get the URLs that D6 has decided are canonical.

In D6 the code that does this is drupal_lookup_path('alias', $path);

By examining this I determined that if you don't care about language, the bare query is (for node/121):

SELECT dst FROM url_alias WHERE src = 'node/121'  ORDER BY pid DESC;


The ORDER BY pid DESC is the key part here.