Re: [HACKERS] Current open 6.3 issues

From: Andrew Martin <martin(at)biochemistry(dot)ucl(dot)ac(dot)uk>
To: maillist(at)candle(dot)pha(dot)pa(dot)us
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Current open 6.3 issues
Date: 1998-01-23 11:45:01
Message-ID: 199801231145.LAA07750@bsmir06.biochem.ucl.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > > psql .psqlrc file startup(Andrew)
> > Unfortunately I simply don't have time to implement any of the nicer suggestions
> > for how this should work. I wish I did...
>
> OK, what are we doing the .psqlrc. Can you send the old patch, or are
> we dropping it for 6.3?
>
> --
> Bruce Momjian
> maillist(at)candle(dot)pha(dot)pa(dot)us
>

Here's the patch I supplied before:

*** src/bin/psql/psql.c.orig Fri Jun 20 21:54:31 1997
--- src/bin/psql/psql.c Fri Jun 20 22:23:49 1997
***************
*** 1598,1603 ****
--- 1598,1605 ----
bool singleSlashCmd = 0;
int c;

+ char *home = NULL; /* Used to store $HOME */
+
memset(&settings, 0, sizeof settings);
settings.opt.align = 1;
settings.opt.header = 1;
***************
*** 1728,1733 ****
--- 1730,1760 ----
printf(" type \\g or terminate with semicolon to execute query\n");
printf(" You are currently connected to the database: %s\n\n", dbname);
}
+
+ /*
+ * 20.06.97 ACRM See if we've got a /etc/psqlrc or .psqlrc file
+ */
+ if(!access("/etc/psqlrc",R_OK))
+ HandleSlashCmds(&settings, "\\i /etc/psqlrc", "");
+ if((home = getenv("HOME"))!=NULL) {
+ char *psqlrc = NULL,
+ *line = NULL;
+
+ if((psqlrc = (char *)malloc(strlen(home) + 10))!=NULL) {
+ sprintf(psqlrc, "%s/.psqlrc", home);
+ if(!access(psqlrc, R_OK)) {
+ if((line = (char *)malloc(strlen(psqlrc) + 5))!=NULL) {
+ sprintf(line, "\\i %s", psqlrc);
+ HandleSlashCmds(&settings, line, "");
+ free(line);
+ }
+ }
+ free(psqlrc);
+ }
+ }
+ /* End of check for psqlrc files */
+
+
if (qfilename || singleSlashCmd) {
/*
* read in a file full of queries instead of reading in queries

Andrew

----------------------------------------------------------------------------
Dr. Andrew C.R. Martin University College London
EMAIL: (Work) martin(at)biochem(dot)ucl(dot)ac(dot)uk (Home) andrew(at)stagleys(dot)demon(dot)co(dot)uk
URL: http://www.biochem.ucl.ac.uk/~martin
Tel: (Work) +44(0)171 419 3890 (Home) +44(0)1372 275775

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 1998-01-23 13:19:22 Re: [HACKERS] Re: [PORTS] Important Announcement
Previous Message Andrew Martin 1998-01-23 11:42:55 Re: [HACKERS] Re: [PORTS] Important Announcement