RFC: PostgreSQL Function Rename (again ;)
| From: | Yasuo Ohgaki | Date: | Fri, 14 Dec 2001 22:18:07 +0000 |
| Subject: | RFC: PostgreSQL Function Rename (again ;) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-73859@lists.php.net to get a copy of this message | ||
Hi all,
I've messed up my request for comments last time.
I think some of you are expecting me to post again ;)
Some names are changed also.
I would like to here your comments about new function
names. I'll commit the change at once, since
async functions are commited already, other changes are
local to it's functions.
Please reply if you have comments.
New functions (including async functions)
pg_send_query
pg_cancel_qeury
pg_get_result
pg_connection_busy
pg_connection_status
pg_connection_reset
pg_result_error
pg_copy_to (Patch by Youichi Iwakiri) pg_copy_from (Patch by Youichi Iwakiri)pg_escape_string (PostrreSQL 7.2 only) pg_escape_bytea (PostgreSQL 7.2 only) pg_loseek pg_lotell Renamed to different name pg_exec -> pg_query pg_errormessage -> pg_last_error pg_getlastoid -> pg_last_oid pg_result -> pg_fetch_result pg_cmdtuples -> pg_affected_rows Other issue pg_lo* -> pg_lo_* ? have only pg_escape and have type parameter? Function planned to be implemented pg_result_status - return result stauts (pg_status may be better to
named pg_connection_status. pg_is_busy may be
better to named pg_connection_busy)
pg_convert_array - convert array elements for SQL statement
accoding to system catalog (metadata)
(i.e. check type & format, escape, add quote
around string)
pg_connection_info - return connection info
pg_ssl_info - return ssl info
API change
pg_loimport, pg_loexport now takes connection as 1st parameter.
Old API still works with NOTICE error message.
/* {{{ pgsql_functions[]
*/
function_entry pgsql_functions[] = {
/* connection functions */
PHP_FE(pg_connect, NULL)
PHP_FE(pg_pconnect, NULL)
PHP_FE(pg_close, NULL)
PHP_FE(pg_connection_status, NULL)
PHP_FE(pg_connection_busy, NULL)
PHP_FE(pg_connection_reset, NULL)
PHP_FE(pg_host, NULL)
PHP_FE(pg_dbname, NULL)
PHP_FE(pg_port, NULL)
PHP_FE(pg_tty, NULL)
PHP_FE(pg_options, NULL)
/* query functions */
PHP_FE(pg_query, NULL)
PHP_FE(pg_send_query, NULL)
PHP_FE(pg_cancel_query, NULL)
/* result functions */
PHP_FE(pg_fetch_result, NULL)
PHP_FE(pg_fetch_row, NULL)
PHP_FE(pg_fetch_array, NULL)
PHP_FE(pg_fetch_object, NULL)
PHP_FE(pg_affected_rows,NULL)
PHP_FE(pg_get_result, NULL)
PHP_FE(pg_free_result, NULL)
PHP_FE(pg_last_oid, NULL)PHP_FE(pg_num_rows, NULL) PHP_FE(pg_num_fields, NULL) PHP_FE(pg_field_name, NULL) PHP_FE(pg_field_num, NULL) PHP_FE(pg_field_size, NULL) PHP_FE(pg_field_type, NULL) PHP_FE(pg_field_prtlen, NULL) PHP_FE(pg_field_is_null,NULL) /* error message functions */ PHP_FE(pg_result_error, NULL) PHP_FE(pg_last_error, NULL) PHP_FE(pg_last_notice, NULL) /* copy functions */ PHP_FE(pg_put_line, NULL) PHP_FE(pg_end_copy, NULL)
PHP_FE(pg_copy_to, NULL) PHP_FE(pg_copy_from, NULL)/* debug functions */ PHP_FE(pg_trace, NULL) PHP_FE(pg_untrace, NULL) /* large object functions */ PHP_FE(pg_locreate, NULL) PHP_FE(pg_lounlink, NULL) PHP_FE(pg_loopen, NULL) PHP_FE(pg_loclose, NULL) PHP_FE(pg_loread, NULL) PHP_FE(pg_lowrite, NULL) PHP_FE(pg_loread_all, NULL) PHP_FE(pg_loimport, NULL) PHP_FE(pg_loexport, NULL) PHP_FE(pg_lolseek, NULL) PHP_FE(pg_lotell, NULL) /* utility functions */ #if HAVE_PQESCAPE PHP_FE(pg_escape_string,NULL) PHP_FE(pg_escape_bytea, NULL) #endif #if HAVE_PQCLIENTENCODING PHP_FE(pg_client_encoding, NULL) PHP_FE(pg_set_client_encoding, NULL) #endif /* aliases for downwards compatibility */
PHP_FALIAS(pg_getlastoid, pg_last_oid, NULL)PHP_FALIAS(pg_cmdtuples, pg_affected_rows, NULL)
PHP_FALIAS(pg_errormessage, pg_last_error, NULL) PHP_FALIAS(pg_numrows, pg_num_rows, NULL) PHP_FALIAS(pg_numfields, pg_num_fields, NULL) PHP_FALIAS(pg_fieldname, pg_field_name, NULL) PHP_FALIAS(pg_fieldsize, pg_field_size, NULL) PHP_FALIAS(pg_fieldtype, pg_field_type, NULL) PHP_FALIAS(pg_fieldnum, pg_field_num, NULL)PHP_FALIAS(pg_fieldprtlen, pg_field_prtlen, NULL) PHP_FALIAS(pg_fieldisnull, pg_field_is_null, NULL)
PHP_FALIAS(pg_freeresult, pg_free_result, NULL) PHP_FALIAS(pg_loreadall, pg_loread_all, NULL) PHP_FALIAS(pg_result, pg_fetch_result, NULL)#if HAVE_PQCLIENTENCODING PHP_FALIAS(pg_clientencoding,pg_client_encoding,NULL) PHP_FALIAS(pg_setclientencoding,pg_set_client_encoding, NULL) #endif {NULL, NULL, NULL} }; /* }}} */ Please reply if you have any comments. Thank you. -- Yasuo Ohgaki