Re: [HACKERS] getpid() function

2002-08-03 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Sorry, I mean pg_backend_pid. Okay, I was unsure if that was a typo or not. > I could expose backend_id but it may > confuse people so pid is probably better. If you had the id, you could > use pg_stat_get_backend_pid() to get the pid. Yeah, I though

Re: [HACKERS] getpid() function

2002-08-03 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > >> Let's take it out and wait to see if anyone really still wants it. > > > Just when I am ready to throw it away, I come up with a use for the > > function: > > > test=> select * from pg_stat_activity where procpid != backend_pid

Re: [HACKERS] getpid() function

2002-08-03 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: >> Let's take it out and wait to see if anyone really still wants it. > Just when I am ready to throw it away, I come up with a use for the > function: > test=> select * from pg_stat_activity where procpid != backend_pid(); > This shows all activi

Re: [HACKERS] getpid() function

2002-08-03 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > As I remember, most cases where people have recently been asking for > > backend pid were related to temp tables because they were named by pid. > > Ah, good point. > > > I don't think they are anymore. (?) > > Check. > > > We c

Re: [HACKERS] getpid() function

2002-08-03 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > As I remember, most cases where people have recently been asking for > backend pid were related to temp tables because they were named by pid. Ah, good point. > I don't think they are anymore. (?) Check. > We can do two things. We can either renam

Re: [HACKERS] getpid() function

2002-08-03 Thread Bruce Momjian
As I remember, most cases where people have recently been asking for backend pid were related to temp tables because they were named by pid. I don't think they are anymore. (?) We can do two things. We can either rename it to pg_backend_pid and move it to the statistics section in the docs, w

Re: [HACKERS] getpid() function

2002-08-03 Thread Tom Lane
Hannu Krosing <[EMAIL PROTECTED]> writes: > You claimed that NOTIFY uses some _other_ backend id (i.e. not process > id). I did? Must have been momentary brain fade on my part. It's always been process ID. regards, tom lane ---(end of broadcast)

Re: [HACKERS] getpid() function

2002-08-03 Thread Hannu Krosing
On Sat, 2002-08-03 at 01:25, Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > Perhaps a more relevant question is why are we cluttering the namespace > > > with any such function at all? What's the use case for it? > > > It was requested because it is exposed in libpq and people

Re: [HACKERS] getpid() function

2002-08-02 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > > Perhaps a more relevant question is why are we cluttering the namespace > > with any such function at all? What's the use case for it? > It was requested because it is exposed in libpq and people need it to > generate unique names and stuff like that

Re: [HACKERS] getpid() function

2002-08-02 Thread Bruce Momjian
Thomas Lockhart wrote: > ... > > Perhaps a more relevant question is why are we cluttering the namespace > > with any such function at all? What's the use case for it? We've > > gotten along fine without one so far, and I don't really think that we > > *ought* to be exposing random bits of inter

Re: [HACKERS] getpid() function

2002-08-02 Thread Karel Zak
On Fri, Aug 02, 2002 at 05:38:37PM +0900, Tatsuo Ishii wrote: > > 2/ PostgreSQL specific functions used in standard SQL operations > > > > (the function works with standard data and not load it from > > internal PostgreSQL stuff). > > > > For example convert(), all datetype functi

Re: [HACKERS] getpid() function

2002-08-02 Thread Christopher Kings-Lynne
> > For example convert(), all datetype function like int(). The name > > convenition must be like names in group 1/ > > FYI, I have been proposing SQL99 compatible convert(). I would like to > add it if no one objects. No objection, but what does it do out of interest? Will it cause a b

Re: [HACKERS] getpid() function

2002-08-02 Thread Tatsuo Ishii
> 2/ PostgreSQL specific functions used in standard SQL operations > > (the function works with standard data and not load it from > internal PostgreSQL stuff). > > For example convert(), all datetype function like int(). The name > convenition must be like names in group 1/

Re: [HACKERS] getpid() function

2002-08-02 Thread Karel Zak
On Thu, Aug 01, 2002 at 01:41:49PM -0400, Bruce Momjian wrote: > > Added to TODO: > > * Consistently name server-side internal functions OK, good start of discussion is define groups of the PostgreSQL functions: 1/ Extern compatible functions The functions compatible with stand

Re: [HACKERS] getpid() function

2002-08-01 Thread Thomas Lockhart
... > Perhaps a more relevant question is why are we cluttering the namespace > with any such function at all? What's the use case for it? We've > gotten along fine without one so far, and I don't really think that we > *ought* to be exposing random bits of internal implementation details > at t

Re: [HACKERS] getpid() function

2002-08-01 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I can rename backend_pid if people want. I just made it consistent > with the other functions in that docs area. Comments? I'd go for pg_backend_pid, I think. It's not an SQL standard function and certainly never will be, so some sort of prefix seem

Re: [HACKERS] getpid() function

2002-08-01 Thread Christopher Kings-Lynne
> No, there isn't (for example, pg_stat_backend_id() versus > current_schema() -- or pg_get_viewdef() versus obj_description() ). > Now that we have table functions, we might be using more built-in > functions to provide information to the user -- so there will be > an increasing need for some kin

Re: [HACKERS] getpid() function

2002-08-01 Thread Bruce Momjian
Peter Eisentraut wrote: > Neil Conway writes: > > > On Thu, Aug 01, 2002 at 12:01:52PM +0200, Karel Zak wrote: > > > Is there some common convention of names? > > > > No, there isn't (for example, pg_stat_backend_id() versus > > current_schema() -- or pg_get_viewdef() versus obj_description() ).

Re: [HACKERS] getpid() function

2002-08-01 Thread Peter Eisentraut
Neil Conway writes: > On Thu, Aug 01, 2002 at 12:01:52PM +0200, Karel Zak wrote: > > Is there some common convention of names? > > No, there isn't (for example, pg_stat_backend_id() versus > current_schema() -- or pg_get_viewdef() versus obj_description() ). The "pg_" naming scheme is obsolete

Re: [HACKERS] getpid() function

2002-08-01 Thread Neil Conway
On Thu, Aug 01, 2002 at 05:09:52PM +0200, Karel Zak wrote: > I know -- for this I asked. IMHO for large project like PostgreSQL > it's important. It's not good if there is possible speculate about > name of new function. It must be unmistakable -- for this is needful > make some convension. If

Re: [HACKERS] getpid() function

2002-08-01 Thread Hannu Krosing
On Thu, 2002-08-01 at 19:41, Bruce Momjian wrote: > > Added to TODO: > > * Consistently name server-side internal functions I'd suggest: * Make up rules for consistently naming server-side internal functions * Consistently name _new_ server-side internal functions * make a plan f

Re: [HACKERS] getpid() function

2002-08-01 Thread Bruce Momjian
I can rename backend_pid if people want. I just made it consistent with the other functions in that docs area. Comments? --- Karel Zak wrote: > On Thu, Aug 01, 2002 at 10:44:23AM -0400, Neil Conway wrote: > > On Thu, Aug

Re: [HACKERS] getpid() function

2002-08-01 Thread Bruce Momjian
Added to TODO: * Consistently name server-side internal functions --- Karel Zak wrote: > On Thu, Aug 01, 2002 at 10:44:23AM -0400, Neil Conway wrote: > > On Thu, Aug 01, 2002 at 12:01:52PM +0200, Karel Zak wrote: >

Re: [HACKERS] getpid() function

2002-08-01 Thread Karel Zak
On Thu, Aug 01, 2002 at 10:44:23AM -0400, Neil Conway wrote: > On Thu, Aug 01, 2002 at 12:01:52PM +0200, Karel Zak wrote: > > Is there some common convention of names? > > No, there isn't (for example, pg_stat_backend_id() versus I know -- for this I asked. IMHO for large project like PostgreS

Re: [HACKERS] getpid() function

2002-08-01 Thread Rod Taylor
On Thu, 2002-08-01 at 10:44, Neil Conway wrote: > On Thu, Aug 01, 2002 at 12:01:52PM +0200, Karel Zak wrote: > > Is there some common convention of names? > functions. However, establishing a naming convention without > breaking backwards compatibility might be tricky. Supporting both names for

Re: [HACKERS] getpid() function

2002-08-01 Thread Neil Conway
On Thu, Aug 01, 2002 at 12:01:52PM +0200, Karel Zak wrote: > Is there some common convention of names? No, there isn't (for example, pg_stat_backend_id() versus current_schema() -- or pg_get_viewdef() versus obj_description() ). Now that we have table functions, we might be using more built-in f

Re: [HACKERS] getpid() function

2002-08-01 Thread Karel Zak
On Tue, Jul 30, 2002 at 09:48:42PM -0400, Bruce Momjian wrote: > > OK, renamed to backend_pid() to match the libpq name. I was unsure > about merging it into the stats stuff myself. > > setest=> select backend_pid(); >backend_pid > - > 12996 >

Re: [HACKERS] getpid() function

2002-07-30 Thread Bruce Momjian
Tom Lane wrote: > [EMAIL PROTECTED] (Neil Conway) writes: > > On Tue, Jul 30, 2002 at 09:48:42PM -0400, Bruce Momjian wrote: > >> Where does the mention belong in the docs? I have it in the monitoring > >> section in the stats section right now. > > > I'd vote for User's Guide -> Functions & Oper

Re: [HACKERS] getpid() function

2002-07-30 Thread Tom Lane
[EMAIL PROTECTED] (Neil Conway) writes: > On Tue, Jul 30, 2002 at 09:48:42PM -0400, Bruce Momjian wrote: >> Where does the mention belong in the docs? I have it in the monitoring >> section in the stats section right now. > I'd vote for User's Guide -> Functions & Operators -> Misc. Functions. T

Re: [HACKERS] getpid() function

2002-07-30 Thread Bruce Momjian
Neil Conway wrote: > On Tue, Jul 30, 2002 at 09:48:42PM -0400, Bruce Momjian wrote: > > OK, renamed to backend_pid() to match the libpq name. > > Ok, thanks. > > > Where does the mention belong in the docs? I have it in the monitoring > > section in the stats section right now. > > I'd vote for

Re: [HACKERS] getpid() function

2002-07-30 Thread Neil Conway
On Tue, Jul 30, 2002 at 09:48:42PM -0400, Bruce Momjian wrote: > OK, renamed to backend_pid() to match the libpq name. Ok, thanks. > Where does the mention belong in the docs? I have it in the monitoring > section in the stats section right now. I'd vote for User's Guide -> Functions & Operator

Re: [HACKERS] getpid() function

2002-07-30 Thread Bruce Momjian
OK, renamed to backend_pid() to match the libpq name. I was unsure about merging it into the stats stuff myself. setest=> select backend_pid(); backend_pid - 12996 (1 row) Where does the mention belong in the docs? I have it

Re: [HACKERS] getpid() function

2002-07-30 Thread Neil Conway
On Tue, Jul 30, 2002 at 08:40:13PM -0400, Bruce Momjian wrote: > I have implemented this TODO item: > > * Add getpid() function to backend > > There were a large number of pg_stat functions that access pids and > backends slots so I added it there: > > test=> select pg_stat_ge