Say I’m storing webpages in PostgreSQL. Is it more convenient to use the URL of the webpage as the primary key, or to create a more succinct SERIAL integer primary key? What is the recommended approach for a case like this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For what purpose are you storing the webpages?
It seems like caching webpages would be dependent on the reason you are caching them. The first thing that comes to mind is that URL’s can change. Do you want your record to change it’s primary key as well? Or would a new URL be a new record?