PostgreSQL - Create table and set specific date format
问题 I want to create a new table and set a date type with a specific format. Is that possible? For example: CREATE TABLE User ( ... EXPIRATION DATE " YYYY/MM" ... ) 回答1: I suggest a different approach: Never store date / time as character type ( text , varchar() , ...) to begin with. Use an appropriate type, probably date in your case. Also, never use reserved words as identifier. user is just not possible to begin with, you would have to double-quote, which I would discourage. Could look like