More network functions...

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: More network functions...
Date: 2004-05-18 19:27:26
Message-ID: 651B9348-A901-11D8-BED8-000A95C705DC@chittenden.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Blah, well, guess I do need the server's address after all. The
attached patch includes:

*) inet_(client|server)_(addr|port)() and necessary documentation for
the four functions.
*) area(PATH) and documentation.
*) Checks for TEMP privs when creating objects in the temp schema
(checks for any object created in a temp namespace).
*) With the above change, current_user is now being used to check if
CREATE TEMP TABLE should succeed.
*) Now cleaning up failed getaddrinfo_all() calls.
*) The check for hintp being null has been removed, all calls to
getaddrinfo_all() are passing non-null hintp's.
*) Changed some freeaddrinfo_all() calls to make sure that the addrinfo
struct is non-null. getaddrinfo_all() can fail and return a null
addrinfo struct and can fail with a non-null addrinfo struct.
*) Updated an error message to include the library path that failed
(handy for debugging old configs that contain $lib instead of $libdir)
*) warn if getaddrinfo_all() fails on postmaster startup.
*) Functions have been updated to be inline with PostgreSQL's style too.

Comments or feedback?

test=# SELECT inet_client_addr();
inet_client_addr
------------------
127.0.0.1
(1 row)

test=# SELECT inet_client_port();
inet_client_port
------------------
52711
(1 row)

test=# SELECT inet_server_port();
inet_server_port
------------------
5432
(1 row)

test=# SELECT inet_server_addr();
inet_server_addr
------------------
127.0.0.1
(1 row)

Attachment Content-Type Size
patch.txt text/plain 15.8 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-05-18 20:18:59 pgsql-server/src backend/main/main.c backend/p ...
Previous Message Bruce Momjian 2004-05-18 18:21:57 Win32 adjustments