importing downloaded data - Mailing list pgsql-general

From Sim Zacks
Subject importing downloaded data
Date
Msg-id 53567F0C.8060605@compulab.co.il
Whole thread Raw
Responses Re: importing downloaded data  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
body p { margin-bottom: 0cm; margin-top: 0pt; }

  <body style="direction: ltr;"
    bidimailui-detected-decoding-type="latin-charset" bgcolor="#FFFFFF"
    text="#000000">
    Postgresql 9.3
    I am downloading data that I want to import into a table. The data
    comes in tab delimited, CRLF format.
    I am using plpython to get the data and I wanted to use copy with
    stdin to import it without having to save it to a file.
    To do this, I am setting sys.stdin to a StringIO object with my data
    inside.

    However, when I call copy I am getting SPI_ERROR_COPY, which the
    docs define as "if COPY TO stdout or COPY FROM stdin was attempted" 
    which is exactly what I am trying to do (so the error is logical).

    Is there another method of loading delimited data in bulk without
    saving it as a file<span style="color: rgb(0, 0, 0); font-family:
      verdana, sans-serif; font-size: 12.499999046325684px; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 18.240001678466797px; orphans: auto;
      text-align: left; text-indent: 0px; text-transform: none;
      white-space: normal; widows: auto; word-spacing: 0px;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); display: inline !important; float: none;">?

      Thanks
      Sim

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: could not rename temporary statistics file "/run/shm/pgstat.tmp" to "/run/shm/pgstat.stat": No such file or directory
Next
From: Albe Laurenz
Date:
Subject: Re: Is this a planner bug?