pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
RFC - change of behaviour of pg_get_userbyid & pg_get_viewdef?
5+ messages / 4 participants
[nested] [flat]

* RFC - change of behaviour of pg_get_userbyid & pg_get_viewdef?
@ 2000-09-24 03:15  Philip Warner <pjw@rhyme.com.au>
  0 siblings, 3 replies; 5+ messages in thread

From: Philip Warner @ 2000-09-24 03:15 UTC (permalink / raw)
  To: pgsql-hackers@postgreSQL.org; pgsql-general@hub.org; pgsql-sql


Two routines do eccentric things when they can't find required supporting
data:

pg_get_userbyid

    returns 'unknown (UID=<uid-number>)' when the UID does not exist.

pg_get_viewdef

    returns 'Not a view' when passed a non-existant or non-view table
    it also signals errors when the underlying metadata can not be found.

The proposal is to return NULL in the above cases - in the final case,
probably also generate a NOTICE.

Does anybody have a problem with this? Think it's a bad idea etc?



----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [HACKERS] RFC - change of behaviour of pg_get_userbyid & pg_get_viewdef?
@ 2000-09-24 23:02  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Philip Warner <pjw@rhyme.com.au>
  2 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2000-09-24 23:02 UTC (permalink / raw)
  To: Philip Warner <pjw@rhyme.com.au>; +Cc: pgsql-hackers@postgresql.org; pgsql-general@hub.org; pgsql-sql

Philip Warner <pjw@rhyme.com.au> writes:
> pg_get_viewdef

>     returns 'Not a view' when passed a non-existant or non-view table
>     it also signals errors when the underlying metadata can not be found.

> The proposal is to return NULL in the above cases - in the final case,
> probably also generate a NOTICE.

I don't believe it's practical to trap errors and return a NULL for
broken views.  Moreover, I do not think it's a good idea to respond
to client errors (invalid view name) the same as database problems
(broken views).  So, I agree with the part of the proposal that says
to return NULL instead of 'Not a view' when there is no view by the
given name, but I do not agree with trying to suppress errors due to
metadata problems.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [HACKERS] RFC - change of behaviour of pg_get_userbyid & pg_get_viewdef?
@ 2000-09-25 00:22  Dominic J. Eidson <sauron@the-infinite.org>
  parent: Philip Warner <pjw@rhyme.com.au>
  2 siblings, 0 replies; 5+ messages in thread

From: Dominic J. Eidson @ 2000-09-25 00:22 UTC (permalink / raw)
  To: pgsql-hackers@postgresql.org; +Cc: pgsql-general@hub.org; pgsql-sql

On Sun, 24 Sep 2000, Philip Warner wrote:

> Two routines do eccentric things when they can't find required supporting
> data:
> 
> pg_get_userbyid
> 
>     returns 'unknown (UID=<uid-number>)' when the UID does not exist.

[Snip]

> The proposal is to return NULL in the above cases - in the final case,
> probably also generate a NOTICE.

In these cases, is NULL = 0? - What if it returns the UID for "root"
(typically UID 0)... I think an error message should/would be better in
this case.

Just my $.02.


-- 
Dominic J. Eidson
                                        "Baruk Khazad! Khazad ai-menu!" - Gimli
-------------------------------------------------------------------------------
http://www.the-infinite.org/              http://www.the-infinite.org/~dominic/




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [HACKERS] RFC - change of behaviour of pg_get_userbyid & pg_get_viewdef?
@ 2000-09-25 01:48  Philip Warner <pjw@rhyme.com.au>
  parent: Philip Warner <pjw@rhyme.com.au>
  2 siblings, 1 reply; 5+ messages in thread

From: Philip Warner @ 2000-09-25 01:48 UTC (permalink / raw)
  To: Dominic J. Eidson <sauron@the-infinite.org>; pgsql-hackers@postgresql.org; +Cc: pgsql-general@hub.org; pgsql-sql

At 19:22 24/09/00 -0500, Dominic J. Eidson wrote:
>
>In these cases, is NULL = 0? - What if it returns the UID for "root"
>(typically UID 0)... I think an error message should/would be better in
>this case.
>

No NULL is NULL, a special value that usually means 'nothing found'.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Re: [HACKERS] RFC - change of behaviour of pg_get_userbyid & pg_get_viewdef?
@ 2000-09-26 12:06  Danny <dannyh@idx.com.au>
  parent: Philip Warner <pjw@rhyme.com.au>
  0 siblings, 0 replies; 5+ messages in thread

From: Danny @ 2000-09-26 12:06 UTC (permalink / raw)
  To: Dominic J. Eidson <sauron@the-infinite.org>; pgsql-hackers@postgresql.org; +Cc: pgsql-general@hub.org; pgsql-sql

-Hello 
- If you want the default value to be "0" the code for that is
default = '0'

Like so

CREATE TABLE Customer (Customer_ID INT Default = '0',

I believe this should work.

dannyh

dannyh@idx.com.au

On Mon, 25 Sep 2000, Philip Warner wrote:
> At 19:22 24/09/00 -0500, Dominic J. Eidson wrote:
> >
> >In these cases, is NULL = 0? - What if it returns the UID for "root"
> >(typically UID 0)... I think an error message should/would be better in
> >this case.
> >
> 
> No NULL is NULL, a special value that usually means 'nothing found'.
> 
> 
> ----------------------------------------------------------------
> Philip Warner                    |     __---_____
> Albatross Consulting Pty. Ltd.   |----/       -  \
> (A.B.N. 75 008 659 498)          |          /(@)   ______---_
> Tel: (+61) 0500 83 82 81         |                 _________  \
> Fax: (+61) 0500 83 82 82         |                 ___________ |
> Http://www.rhyme.com.au          |                /           \|
>                                  |    --________--
> PGP key available upon request,  |  /
> and from pgp5.ai.mit.edu:11371   |/



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2000-09-26 12:06 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-09-24 03:15 RFC - change of behaviour of pg_get_userbyid & pg_get_viewdef? Philip Warner <pjw@rhyme.com.au>
2000-09-24 23:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-09-25 00:22 ` Dominic J. Eidson <sauron@the-infinite.org>
2000-09-25 01:48 ` Philip Warner <pjw@rhyme.com.au>
2000-09-26 12:06   ` Danny <dannyh@idx.com.au>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox