Re: \du in psql patchp

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: \du in psql patchp
Дата
Msg-id 200105091757.f49HvJl15666@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: \du in psql patchp  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-patches
> Bruce Momjian writes:
>
> > Patch applied.  I removed the reference to asprintf() and changed it to
> > a string constant.  I have also added documentation changes.  Patch
> > attached.
>
> I think there's a memory leak, count your xmalloc's.  Also, perhaps the

I thought I had too many mallocs, but when I started looking, I couldn't
find the second one anymore.  I see it now, and fixed.  Looped through
cell and free'ed:

    for (i = 0; i < PQntuples(res); i++)
        free(cells[i * cols + 2]);
    free(cells);


> user ids should be right-aligned (printTable, 5th argument).

Got it:

    test=> \du
                    List of Users
     User Name | User ID |       Attributes
    -----------+---------+------------------------
     demouser2 |     140 | create DB
     postgres  |     139 | create user, create DB

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: \du in psql patchp
Следующее
От: Alex Perel
Дата:
Сообщение: Re: \du in psql patchp