diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
new file mode 100644
index 662eab7..1ea728b
*** a/doc/src/sgml/ref/psql-ref.sgml
--- b/doc/src/sgml/ref/psql-ref.sgml
*************** PSQL_EDITOR_LINENUMBER_ARG='--line '
*** 3332,3338 ****
       Both the system-wide <filename>psqlrc</filename> file and the user's
       <filename>~/.psqlrc</filename> file can be made version-specific
       by appending a dash and the <productname>PostgreSQL</productname>
!      release number, for example <filename>~/.psqlrc-&version;</filename>.
       A matching version-specific file will be read in preference to a
       non-version-specific file.
      </para>
--- 3332,3338 ----
       Both the system-wide <filename>psqlrc</filename> file and the user's
       <filename>~/.psqlrc</filename> file can be made version-specific
       by appending a dash and the <productname>PostgreSQL</productname>
!      major release number, for example <filename>~/.psqlrc-9.2</filename>.
       A matching version-specific file will be read in preference to a
       non-version-specific file.
      </para>
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
new file mode 100644
index 3c17eec..9670b7e
*** a/src/bin/psql/startup.c
--- b/src/bin/psql/startup.c
*************** process_psqlrc_file(char *filename)
*** 600,607 ****
  #define R_OK 4
  #endif
  
! 	psqlrc = pg_malloc(strlen(filename) + 1 + strlen(PG_VERSION) + 1);
! 	sprintf(psqlrc, "%s-%s", filename, PG_VERSION);
  
  	if (access(psqlrc, R_OK) == 0)
  		(void) process_file(psqlrc, false, false);
--- 600,607 ----
  #define R_OK 4
  #endif
  
! 	psqlrc = pg_malloc(strlen(filename) + 1 + strlen(PG_MAJORVERSION) + 1);
! 	sprintf(psqlrc, "%s-%s", filename, PG_MAJORVERSION);
  
  	if (access(psqlrc, R_OK) == 0)
  		(void) process_file(psqlrc, false, false);
