For Canada, you can try here:
http://www.populardata.com/postalcode_database.html
765K records.
for USA:
Sourceforge has an open zip database project, and I found that SF would be useful in the past. Do you need zippers to be completely modern? Since I believe that the US post office can be quite moody with borders and postal code definitions, especially in the newly developed parts of the USA.
http://sourceforge.net/projects/zips/
csv or mysql.
caveat: approval rating of 50% out of 10 users currently. more caveats: since 2005.
jpwco source share