Thread

  1. Re: ipcclean in 8.1 broken?

    Brusser, Michael <michael.brusser@matrixone.com> — 2006-03-01T14:39:58Z

    I wonder if there could be a potential problem with using this approach
    -
    checking on $USER == root.
    
    Although it is a common practice, I think a superuser does not have to
    be root.
    If I'm right here, a better technique could be executing `id`.
    
    Mike
     
    
    -----Original Message-----
    From: pgsql-hackers-owner@postgresql.org
    [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Peter
    Eisentraut
    Sent: Wednesday, March 01, 2006 6:49 AM
    To: pgsql-hackers@postgresql.org
    Cc: Christopher Kings-Lynne
    Subject: Re: [HACKERS] ipcclean in 8.1 broken?
    
    Am Dienstag, 28. Februar 2006 07:42 schrieb Christopher Kings-Lynne:
    > I just tried using ipcclean in 8.1.3.  It doesn't work when I su to
    the
    > pgsql user.  This part of the script:
    >
    > if [ "$USER" = 'root' -o "$LOGNAME" = 'root' ]
    >
    > Always fails because even tho $USER is set to 'pgsql' when su'ed,
    > $LOGNAME is still root.
    >
    > This is on FreeBSD 4.9
    
    
  2. Re: ipcclean in 8.1 broken?

    Christopher Kings-Lynne <chriskl@familyhealth.com.au> — 2006-03-02T01:29:22Z

    > I wonder if there could be a potential problem with using this approach
    > -
    > checking on $USER == root.
    > 
    > Although it is a common practice, I think a superuser does not have to
    > be root.
    
    Yes, like the 'toor' account in FreeBSD... (disabled by default though)
    
    Chris
    
    
    
  3. Re: ipcclean in 8.1 broken?

    Mark Kirkwood <markir@paradise.net.nz> — 2006-03-02T01:58:42Z

    Christopher Kings-Lynne wrote:
    >> I wonder if there could be a potential problem with using this approach
    >> -
    >> checking on $USER == root.
    >>
    >> Although it is a common practice, I think a superuser does not have to
    >> be root.
    > 
    > 
    > Yes, like the 'toor' account in FreeBSD... (disabled by default though)
    > 
    
    Might be better to check if uid == 0, however there are some traps here 
    too as the most convenient methd ('id -u') is not support everywhere 
    (e.g Solaris 8). I think I used awk or sed on the plain old 'id' output 
    last time something like this came up.
    
    Cheers
    
    Mark
    
    
  4. display processing time?

    John <xiaoqianjiang@hotmail.com> — 2006-03-02T04:13:02Z

    I have a question about how to display query time of  postgres.  I found 
    this
    postgres [ -A { 0 | 1 } ] [ -B buffers ] [ -c name=value ] [ -d
     debug-level ]
               [ -D datadir ] [ -e ] [ -E ] [ -f { s | i | n | m | h } ] [ -F ]
               [ -i ] [ -L ] [ -N ] [ -o file-name ] [ -O ] [ -P ]
               [ -s | -t { pa | pl | ex } ] [ -S sort_mem ] [ -W num ] database
    
    adding -s will print the statistis and time. But I have no idea how to call 
    this using postmaster -o option. Anyone give me a hint? Thanks.
    
    -John 
    
    
  5. Re: display processing time?

    Michael Fuhr <mike@fuhr.org> — 2006-03-02T04:34:48Z

    On Wed, Mar 01, 2006 at 10:13:02PM -0600, John wrote:
    > adding -s will print the statistis and time. But I have no idea how to call 
    > this using postmaster -o option. Anyone give me a hint? Thanks.
    
    postmaster -o -s [ other options ]
    
    Or you could enable log_statement_stats in postgresql.conf.
    
    -- 
    Michael Fuhr