<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Sarthak,<br>
    <br>
    The first version is not working (do you test it?):
    <a class="moz-txt-link-freetext"
href="https://github.com/sarthak-0415/gdal/commit/36344cc26f23202cb289390322c1d295697136bd#diff-31df0e62d00ca09f9f11ad2f29e94b54R2541">https://github.com/sarthak-0415/gdal/commit/36344cc26f23202cb289390322c1d295697136bd#diff-31df0e62d00ca09f9f11ad2f29e94b54R2541</a><br>
    Here you try to get array value with index -1. You need to set <span
      class="blob-code-inner">ppszDbname = NULL no DB name present in
      input parameters.<br>
      <br>
      The second variant is not working too:<br>
      >>> ds = gdal.Open('PG:')<br>
      terminate called after throwing an instance of 'std::logic_error'<br>
        what():  basic_string::_M_construct null not valid<br>
      <br>
      In both cases there is a problem here:
      <a class="moz-txt-link-freetext"
href="https://github.com/sarthak-0415/gdal/blob/6264d3fc52242fdce858547cc3a0312b04fd638b/gdal/frmts/postgisraster/postgisrasterdataset.cpp#L2743">https://github.com/sarthak-0415/gdal/blob/6264d3fc52242fdce858547cc3a0312b04fd638b/gdal/frmts/postgisraster/postgisrasterdataset.cpp#L2743</a><br>
      <br>
      Also look there </span><span class="blob-code-inner">ppszDbname
      is using, as before modifications the </span><span
      class="blob-code-inner">code expect that ppszDbname cannot be
      NULL.<br>
    </span>
    <pre class="moz-signature" cols="72">Best regards,
    Dmitry</pre>
    <div class="moz-cite-prefix">15.03.2016 13:13, sarthak agarwal
      пишет:<br>
    </div>
    <blockquote
cite="mid:CAPwn9cz4eab1BeyXWDUGbnj8CQ9fg=zCoTFU-49FH23tX24VdQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="markdown-here-wrapper" style="">
          <p style="margin:0px 0px 1.2em!important">Hey Dmitry ,<br>
            As discussed on the IRC yesterday,<br>
            I made the changes in the code.</p>
          <p style="margin:0px 0px 1.2em!important">I build two versions
            of the code</p>
          <ol style="margin:1.2em 0px;padding-left:2em">
            <li style="margin:0.5em 0px">
              <p style="margin:0px 0px 1.2em!important;margin:0.5em
                0px!important">The changes suggested by you (to use the
                old trunk code and remove the additional checks) <a
                  moz-do-not-send="true"
href="https://github.com/sarthak-0415/gdal/commit/36344cc26f23202cb289390322c1d295697136bd">link</a>
                <a moz-do-not-send="true"
                  href="https://travis-ci.org/sarthak-0415/gdal/builds/116070409">travis</a>
                .<br>
                a. in this version the Dbname is left empty if not
                provided by the user.</p>
            </li>
            <li style="margin:0.5em 0px">
              <p style="margin:0px 0px 1.2em!important;margin:0.5em
                0px!important">The version in which we<br>
                a. if the Dbname is provided by the user then
                ppzDbname=Dbname.<br>
                b. else use the psql env var PGDATABASE<br>
                c. else use the Username as the database name.<br>
                d. if nothing is available then pass empty string.<br>
                e <a moz-do-not-send="true"
href="https://github.com/sarthak-0415/gdal/commit/6264d3fc52242fdce858547cc3a0312b04fd638b">link</a>
                <a moz-do-not-send="true"
                  href="https://travis-ci.org/sarthak-0415/gdal/builds/116055868">travis</a></p>
            </li>
          </ol>
          <p style="margin:0px 0px 1.2em!important">I think both version
            should work</p>
          <p style="margin:0px 0px 1.2em!important">Regards,<br>
            Sarthak</p>
        </div>
      </div>
    </blockquote>
  </body>
</html>