Re: Few Simple Questions - Mailing list pgsql-general

From Richard Huxton
Subject Re: Few Simple Questions
Date
Msg-id 200302280959.17406.dev@archonet.com
Whole thread Raw
In response to Few Simple Questions  (Ivan <iv@psycho.pl>)
Responses Re: Few Simple Questions
Re: Few Simple Questions
List 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

pgsql-general by date:

Previous
From: Peter Childs
Date:
Subject: Re: 7.4?
Next
From: Arjen van der Meijden
Date:
Subject: Re: phpBB2 slow on postgres vs mysql ?