title: How to change primary key of a postgres database table from bill no to bill no and year part of purchase date column(it is oif type date)?
body: <p>I have a table called <code>product_details</code> in my PostgreSQL database, two columns of this table are <code>bill_no INT</code> and <code>purchase_date DATE</code>.</p>
  
  <p>Currently <code>bill_no</code> is the primary key, but my client wants it changed to <code>bill_no</code> and year of purchase, as bill numbers start with 1 at the start of every year.</p>
  
  <p>Is there a way to change the primary key of the table to <code>bill_no</code> and only the <strong>year part</strong> of <code>purchase_date</code>?</p>