Re: Few Simple Questions

From: Richard Huxton <dev(at)archonet(dot)com>
To: Ivan <iv(at)psycho(dot)pl>, pgsql-general(at)postgresql(dot)org
Subject: Re: Few Simple Questions
Date: 2003-02-28 09:59:16
Message-ID: 200302280959.17406.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 27 Feb 2003 8:05 pm, Ivan wrote:
> HI
>
> how can i get user ip, who can only connect by tcp/ip , for example in
> plpgsql function . ??

This has come up before - check the archives, I'm afraid I can't remember the
solution.

> how can declare and define my own variables in each connect to db, and
> read it / or change it in plpgsql function ?

You can't AFAIK - usual method is to store session variables in the
application or in a session-table.

> is possible to create this same name of users in one postmaster but in
> different db ?

Not AFAIK - users are for a cluster of databases, a whole installation.

> how to change default grant to created objects, (tables ,functions, etc) ?

Sorry, not sure what you mean here.

> where can i change max length of function's name ? its can be only in one
> place ?

Don't know, but it will be in the source code and will probably affect all
objects (you'll be redefining the "name" type I'd suspect).

> how can i return more then 1 row in one time in function with SETOF
> same_type; (plpgsql) like : RETURN NEXT SELECT f FROM BIG_TABLE ;

Look up table functions in the 7.3 manuals, and on
http://techdocs.postgresql.org - there are some good examples in techdocs.

> how to disallow user to create anything, user for example can select from
> same function. this user also can not see others databases and objects in
> actual db .. etc ( it should be default ?? ) ?

Not sure you can stop them seeing other objects. If a user can't read the
system tables, they can't see anything.

> how set default value of function's args.

Well, this depends on the language you write the function in. It won't help
much though, because PG's type matching doesn't allow you to leave out
function arguments. if it's defined as f(int,int) then it needs two integers
passed to it.

HTH
--
Richard Huxton

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Gilbert 2003-02-28 10:22:21 Re: initdb hangs even though ipc-daemon is running?
Previous Message Peter Childs 2003-02-28 09:49:08 Re: 7.4?