FRC: PostgreSQL function names change

From: Date: Tue, 11 Dec 2001 05:05:36 +0000
Subject: FRC: PostgreSQL function names change
Groups: php.dev 
Request: Send a blank email to php-dev+get-73186@lists.php.net to get a copy of this message
Sorry if this message is posted twice. Hi all, I would like to change PostgreSQL function names to comfirm coding standard. Similar change has been done for MySQL module, AFIAK. Documentation will be updated just like MySQL function names were changed. This is a proposed change. Almost all changes are just a matter of adding "_" to current names, except pg_cmdtuples. The new name is pg_affected_rows, like MySQL. I didn't change pg_lo*, if you think I should change them to pg_lo_*, please let me know. (Exception is pg_loreadall, new name is pg_loread_all) There are new functions in this definition (pg_result_error_message, pg_lolseek, pg_lotell, pg_copy_to, pg_copy_from). I'll commit these functions later, since these functions are not tested yet. Please let me know if you come up with better names, before I'm going to commit this change and update documentation. (Or let me know if I shouldn't do that :) Thank you for your comments. /* {{{ pgsql_functions[] */ function_entry pgsql_functions[] = {
    PHP_FE(pg_connect,    NULL)
    PHP_FE(pg_pconnect,    NULL)
    PHP_FE(pg_close,    NULL)
    PHP_FE(pg_affected_rows,NULL)
    PHP_FE(pg_last_notice,  NULL)
    PHP_FE(pg_dbname,    NULL)
    PHP_FE(pg_error_message,NULL)
        PHP_FE(pg_result_error_message, NULL)
    PHP_FE(pg_trace,    NULL)
    PHP_FE(pg_untrace,    NULL)
    PHP_FE(pg_options,    NULL)
    PHP_FE(pg_port,        NULL)
    PHP_FE(pg_tty,        NULL)
    PHP_FE(pg_host,        NULL)
    PHP_FE(pg_exec,        NULL)
    PHP_FE(pg_num_rows,    NULL)
    PHP_FE(pg_num_fields,    NULL)
    PHP_FE(pg_field_name,    NULL)
    PHP_FE(pg_field_size,    NULL)
    PHP_FE(pg_field_type,    NULL)
    PHP_FE(pg_field_num,    NULL)
    PHP_FE(pg_result,    NULL)
    PHP_FE(pg_fetch_row,    NULL)
    PHP_FE(pg_fetch_array,    NULL)
    PHP_FE(pg_fetch_object,    NULL)
    PHP_FE(pg_field_prtlen,    NULL)
    PHP_FE(pg_field_is_null,NULL)
    PHP_FE(pg_free_result,    NULL)
    PHP_FE(pg_get_last_oid,    NULL)
    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)
#if HAVE_LOLSEEK
    PHP_FE(pg_lolseek,    NULL)
#endif #if HAVE_LOTELL
    PHP_FE(pg_lotell,    NULL)
#endif
    PHP_FE(pg_put_line,    NULL)
    PHP_FE(pg_end_copy,    NULL)
        PHP_FE(pg_copy_to,      NULL)
        PHP_FE(pg_copy_from,    NULL)
#if HAVE_PQCLIENTENCODING
    PHP_FE(pg_client_encoding,    NULL)
    PHP_FE(pg_set_client_encoding,    NULL)
#endif
    PHP_FE(pg_reset,     NULL)
    PHP_FE(pg_status,     NULL)
    PHP_FE(pg_send_query,     NULL)
    PHP_FE(pg_request_cancel,NULL)
    PHP_FE(pg_get_result,     NULL)
    PHP_FE(pg_is_busy,     NULL)
    /* aliases for downwards compatibility */
    PHP_FALIAS(pg_getlastoid,    pg_get_last_oid,   NULL)
    PHP_FALIAS(pg_cmdtuples,     pg_affected_rows,  NULL)
    PHP_FALIAS(pg_errormessage,  pg_error_message,  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)
#if HAVE_PQCLIENTENCODING
    PHP_FALIAS(pg_clientencoding,    pg_client_encoding,    NULL)
    PHP_FALIAS(pg_setclientencoding,pg_set_client_encoding,    NULL)
#endif
    {NULL, NULL, NULL}
}; /* }}} */ -- Yasuo Ohgaki

« previous php.dev (#73186) next »