]> granicus.if.org Git - postgresql/blob - src/bin/pg_version/pg_version.c
Use new utils/version.c instead of backend/utils/init/magic.c.
[postgresql] / src / bin / pg_version / pg_version.c
1 /*-------------------------------------------------------------------------
2  *
3  * pg_version.c--
4  *    
5  *
6  * Copyright (c) 1994, Regents of the University of California
7  *
8  *
9  * IDENTIFICATION
10  *    $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/pg_version.c,v 1.6 1996/11/12 06:47:00 bryanh Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #include <stdlib.h>
15 #include <stdio.h>
16
17 #include <version.h>    /* interface to SetPgVersion */
18
19
20
21 int
22 main(int argc, char **argv)
23 {
24     int retcode;    /* our eventual return code */
25     char *reason;   /* Reason that SetPgVersion failed, NULL if it didn't. */
26
27     if (argc < 2) {
28         fprintf(stderr, "pg_version: missing argument\n");
29         exit(1);
30     }
31     SetPgVersion(argv[1], &reason);
32     if (reason) {
33         fprintf(stderr, 
34                 "pg_version is unable to create the PG_VERSION file. "
35                 "SetPgVersion gave this reason: %s\n",
36                 reason);
37         retcode = 10;
38     } else retcode = 0;
39     return(retcode);
40 }