zoukankan      html  css  js  c++  java
  • PostgreSQL的 initdb 源代码分析之十八

    继续分析:

        setup_conversion();

    展开:

    其实质是:

    运行命令:"/home/pgsql/project/bin/postgres" --single -F -O -c search_path=pg_catalog -c exit_on_error=true template1 >/dev/null

    传递参数:/home/pgsql/project/share/conversion_create.sql

    /*
     * load conversion functions
     */
    static void
    setup_conversion(void)
    {
        PG_CMD_DECL;
        char      **line;
        char      **conv_lines;
    
        fputs(_("creating conversions ... "), stdout);
        fflush(stdout);
    
        snprintf(cmd, sizeof(cmd),
                 ""%s" %s template1 >%s",
                 backend_exec, backend_options,
                 DEVNULL);
    
        PG_CMD_OPEN;
    
        conv_lines = readfile(conversion_file);
        for (line = conv_lines; *line != NULL; line++)
        {
            if (strstr(*line, "DROP CONVERSION") != *line)
                PG_CMD_PUTS(*line);
            free(*line);
        }
    
        free(conv_lines);
    
        PG_CMD_CLOSE;
    
        check_ok();
    }
  • 相关阅读:
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    How to build and run ARM Linux on QEMU from scratch
    How to debug Android Native Application with eclipse
  • 原文地址:https://www.cnblogs.com/gaojian/p/3179198.html
Copyright © 2011-2022 走看看