Re: psql setenv command

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql setenv command
Date: 2011-11-29 02:19:27
Message-ID: CAK3UJRHT-+OtunBxm+6m1WH4Fn-HXqsLQE-cfiRM1mrYeeVaYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 26, 2011 at 11:02 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> Also, should the malloc() of newval just use pg_malloc() instead?
>
> Yes, also done.

This bit is unnecessary, since pg_malloc() takes care of the error handling:

+ if (!newval)
+ {
+ psql_error("out of memory\n");
+ exit(EXIT_FAILURE);
+ }

Also, the help output for setenv bleeds over an 80-character terminal,
and it seems the rest of the help outputs try to stay under this
limit. And an OCD nitpick: most of the psql-ref.sgml examples show
'testdb' at the prompt, how about we follow along.

Other than those small gripes, the patch looks fine. Attached is an
updated version to save you some keystrokes.

Josh

Attachment Content-Type Size
setenv.v7.patch text/x-patch 3.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-11-29 02:38:51 Allow pg_dumpall to use dumpmem.c functions, simplify exit code
Previous Message Tom Lane 2011-11-29 02:11:51 Re: Patch: add timing of buffer I/O requests