Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gVJYg-0002yS-8j for pgsql-general@arkaria.postgresql.org; Fri, 07 Dec 2018 17:04:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gVJYe-0002p6-Ns for pgsql-general@arkaria.postgresql.org; Fri, 07 Dec 2018 17:04:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gVJYd-0002oz-N8 for pgsql-general@lists.postgresql.org; Fri, 07 Dec 2018 17:04:56 +0000 Received: from nh504-vm6.bullet.mail.kks.yahoo.co.jp ([183.79.57.92]) by magus.postgresql.org with smtp (Exim 4.89) (envelope-from ) id 1gVJYU-00045O-CX for pgsql-general@lists.postgresql.org; Fri, 07 Dec 2018 17:04:51 +0000 Received: from [183.79.100.141] by nh504.bullet.mail.kks.yahoo.co.jp with NNFMP; 07 Dec 2018 17:04:39 -0000 Received: from [183.79.100.137] by t504.bullet.mail.kks.yahoo.co.jp with NNFMP; 07 Dec 2018 17:04:39 -0000 Received: from [127.0.0.1] by omp506.mail.kks.yahoo.co.jp with NNFMP; 07 Dec 2018 17:04:39 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 595183.90464.bm@omp506.mail.kks.yahoo.co.jp X-YMail-OSG: QiykYDoVM1l3PQ884C.6e4Tf9Q8MfadYCR7uskLhymg1m5ChoRXScvyNAFzUZ8g WqYmtNH2nb46WD6oYxRQlGAQvrnkQSpBD0e_y8pIF_e7KM6RFqmj6JCoxE2.dbwUKbY19TdUtJy7 u29kHUckOiv4mCnAAVgucESTdRoYb2uXS1hm50X2kksB8ZAgfKcV3NOShylZB8aIwKvYw5B.EmSS 5rpQrsfPRP9ymZFEZTzvhcps1OuHS47qIxAh51AX7l8LgP0K1hkC_Yzc3PppmDMqQe3wOJZCfJ25 6Hk.9GPOOW6z7NxVPmWWH.F6ZS5sPNc6eXVDPEXsRXg6oIvsiRAJ_ZndAfIXPdRreDBYsRowMvBJ THVlWwNOE6HWQnFLTO68gW6TyKKlUuHntQ8w.0iVajFgXKi0gfSxngtERJIdQpHomS4EcIayVb4M 4CpEVCsY3VUVn7Oi2O6GG6DcdNs2ZYb646JkLMFNrgFcJTQsQ8ExiE9hs.w6TvuSnfeWBsOYlJim 3_qS1yZNJ7Uq77ECrpzp823KqTx.ZDq2Ly8xJCT3vASFNIW6m9S3dQDscDePooyIYTAex8iah_lE 5TwgcNk7HARfXQ4FOjsjAFfdSIWDO.e6soBsI9Gk- Received: from jws700103.mail.ssk.yahoo.co.jp by sendmailws617.mail.ssk.yahoo.co.jp; Sat, 08 Dec 2018 02:04:38 +0000; 1544202278.936 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1544202279; s=yj20110701; d=yahoo.co.jp; h=Date:From:Reply-To:To:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type; bh=d4X3qdlAqNWxJboy5LVDNhk204uPZgw5h6CZeMWHDKA=; b=WeNp1xLyTRrmlnGJDPFHu01c33ZT1MyNO/JnD0hrDbJ2w7Z1msHSbYFppIP8io+3 DWyQV1CWviprPED/2CHJpzDGQbTtVDQo0Z1jW3gNtjOQezX14zA2O+XV6ERuT0u/w+d NpAkJCGEbqGrfKC8D1StvdTMYhJW3Itf7xp4vopM= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=yj20110701; d=yahoo.co.jp; h=Date:From:Reply-To:Message-ID:In-Reply-To:References:MIME-Version:Content-Type; b=YsIGX0aW/AugcfSK3tAQtz76TIUGfbAWn6RDuGRx8OiQRw/+6ki8UYfsFg6+GzWN r6FJ9EedcgP3GtN+QN7k5pZhazS3htK0BPVziOp30Pw7qbcykZYck+82gwHIZ+s7bTJ c8LD8gWBwyzrCuKk5RSwLs3feAKq/mhQw4DFSjg4=; X-yjpVirusScan: Scanned Date: Sat, 8 Dec 2018 02:04:38 +0900 (JST) From: Reply-To: To: Adrian Klaver , rob stone , "pgsql-general@lists.postgresql.org" Message-ID: <683172210.269176.1544202278516.JavaMail.yahoo@mail.yahoo.co.jp> In-Reply-To: <4969722f-8869-fa9b-d843-05bc863306f4@aklaver.com> References: <1892755171.196556.1544154847195.JavaMail.yahoo.ref@mail.yahoo.co.jp> <1892755171.196556.1544154847195.JavaMail.yahoo@mail.yahoo.co.jp> <1c54581d-541d-10d9-138c-55b87ecded2c@aklaver.com> <5e4cd2243e4e89afdad1ab7fb503825084f771ab.camel@gmail.com> <1078893091.227120.1544171298546.JavaMail.yahoo@mail.yahoo.co.jp> <4969722f-8869-fa9b-d843-05bc863306f4@aklaver.com> Subject: Re: Importing tab delimited text file using phpPgAdmin 5.1 GUI MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_269175_2064096532.1544202278510" Content-Length: 21049 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_269175_2064096532.1544202278510 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I didn't specify any schema, so it was created in public schema.The error m= essage also says "public"...//---------------------------------------------= ---------------------ERROR: column "=EF=BB=BFrec_id" of relation "spec" doe= s not existLINE 1: INSERT INTO "public"."spec" ("=EF=BB=BFrec_id","title_c.= ..//------------------------------------------------------------------ Output of the \d spec: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Table "public= .spec"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Column=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Type=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0| Modifiers=C2=A0----------------------------+--= -----------------------+-----------=C2=A0rec_id=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| character varying(32)=C2= =A0 =C2=A0| not null=C2=A0title_category=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| character varying(255)=C2=A0 |=C2=A0=C2=A0doctype=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | character var= ying(255)=C2=A0 |=C2=A0=C2=A0... goes on like this for other columns. What are you trying to see in the output of \d spec? I don't understand what you mean by the import code is trying to insert in = to wrong version of the table.I visually checked the left side "menu like" = structure of the phpPgAdmin- there is no other table of that name. You mentioned that quoted identifiers are not the issue.This prompted me to= test the process in a table with a few columns and ascii characters.Immedi= ately it was clear that=C2=A0quoted identifiers were not to blame. I found that I got that error when I change encoding of the tab delimited f= ile to UTF-8.=C2=A0Because my data contains non-ascii characters, if I don'= t use UTF-8, I get this error. ERROR: invalid byte sequence for encoding "UTF8": 0x82 ... and I read somewhere that if I open the text file in notpad and save it= with UTF-8 encoding, I can get rid of the error. (When inserting using pyD= ev (psycopg2)/Eclipse, that does get rid of the error... That's why I changed encoding. And now I am stuck with this error. But at least, now I am not blaming phpPgAdmin :)Thanks for the lead.=C2=A0 BTW, both server and client encoding of my pg db are UTF8. testdb=3D# SHOW SERVER_ENCODING;=C2=A0server_encoding=C2=A0----------------= -=C2=A0UTF8(1 row) testdb=3D# SHOW CLIENT_ENCODING;=C2=A0client_encoding=C2=A0----------------= -=C2=A0UTF8(1 row) testdb=3D# ----- Original Message ----- From: Adrian Klaver To: s400t@yahoo.co.jp; rob stone ; "pgsql-general@li= sts.postgresql.org" =20 Date: 2018/12/7, Fri 23:47 Subject: Re: Importing tab delimited text file using phpPgAdmin 5.1 GUI =20 On 12/7/18 12:28 AM, s400t@yahoo.co.jp wrote: > Hello Adrian, Rob! >=20 > Thank you for the comments. >=20 > Oh, yes, I forgot to mention that I am using Postgresql version 9.6. > I had read somewhere that last supported version was 9.3 or something,=20 > could be 9.2 as you say. >=20 > I wanted to use phpPgAdmin, that's why I went back to 9.6 even if I had= =20 > installed ver. 10 first. > But if the phpPgAdmin quotes identifiers by defaults, I will need to=20 > look for some other ways. I don't think the quoted identifiers are the issue. I am suspecting that=20 the import code may be trying to INSERT into the wrong version of the=20 table. Some questions: 1) Which schema did you create spec in? 2) In psql what does \d spec show? >=20 > Strictly speaking, I don't need to use the phpPgAdmin, but I am trying=20 > to find a GUI way to upload a file quickly (the file has thousands of=20 > records.) >=20 > Now, I am using pyDev in Eclipse to insert records, but I need to use a= =20 > web-based click and upload. ? https://www.pgadmin.org/=20 >=20 > If I could find a php version of my python code that would be great! > My Python code: >=20 > cur =3D conn.cursor() >=20 > with io.open(fileName,'r',encoding=3D'utf8') as f: >=C2=A0 =C2=A0 =C2=A0 next(f)=C2=A0 # Skip header row. >=C2=A0 =C2=A0 =C2=A0 cur.copy_from(f, tableName, sep=3D'\t') > conn.commit() > cur.close() > f.close() >=20 >=20 > I have found PHP samples for line by line read and insert, but that will= =20 > be too slow for me. >=20 > Cheers! >=20 >=20 >=20 >=C2=A0 =C2=A0 ----- Original Message ----- >=C2=A0 =C2=A0 *From:* rob stone >=C2=A0 =C2=A0 *To:* Adrian Klaver ; s400t@yahoo= .co.jp; >=C2=A0 =C2=A0 "pgsql-general@lists.postgresql.org" >=C2=A0 =C2=A0 >=C2=A0 =C2=A0 *Date:* 2018/12/7, Fri 16:47 >=C2=A0 =C2=A0 *Subject:* Re: Importing tab delimited text file using phpPg= Admin >=C2=A0 =C2=A0 5.1 GUI >=20 >=C2=A0 =C2=A0 Hello, >=20 >=C2=A0 =C2=A0 On Thu, 2018-12-06 at 21:29 -0800, Adrian Klaver wrote: >=C2=A0 =C2=A0 =C2=A0 > On 12/6/18 7:54 PM, s400t@yahoo.co.jp >=C2=A0 =C2=A0 wrote: >=C2=A0 =C2=A0 =C2=A0 > >=C2=A0 =C2=A0 =C2=A0 > Most GUI tools I am familiar with quote identifiers= by default. >=C2=A0 =C2=A0 =C2=A0 > > How/where can I tell the phpPgAdmin not to add th= at extra "" around >=C2=A0 =C2=A0 =C2=A0 > > the >=C2=A0 =C2=A0 =C2=A0 > > field name? >=C2=A0 =C2=A0 =C2=A0 > >=C2=A0 =C2=A0 =C2=A0 > I don't know. I have been under the impression that= phpPgAdmin was >=C2=A0 =C2=A0 =C2=A0 > no >=C2=A0 =C2=A0 =C2=A0 > longer maintained/in use. >=C2=A0 =C2=A0 =C2=A0 > >=C2=A0 =C2=A0 =C2=A0 > You might have more luck here: >=C2=A0 =C2=A0 =C2=A0 > >=C2=A0 =C2=A0 =C2=A0 > https://sourceforge.net/p/phppgadmin/discussion/115= 884=20 >=C2=A0 =C2=A0 =C2=A0 > >=C2=A0 =C2=A0 =C2=A0 > > >=C2=A0 =C2=A0 =C2=A0 > > Thanks for reading and suggestions. >=C2=A0 =C2=A0 =C2=A0 > >=C2=A0 =C2=A0 =C2=A0 > >=20 >=C2=A0 =C2=A0 If you look at phppgadmin on sourceforge, the tarball files = are all >=C2=A0 =C2=A0 dated April 15th., 2013. >=C2=A0 =C2=A0 It appears to have stalled at Postgres version 9.2. >=C2=A0 =C2=A0 I doubt if it will run on versions 10 or 11. >=20 >=C2=A0 =C2=A0 Cheers, >=C2=A0 =C2=A0 Rob >=20 >=20 >=20 >=20 >=20 >=20 --=20 Adrian Klaver adrian.klaver@aklaver.com =20 ------=_Part_269175_2064096532.1544202278510 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I didn't specify any schema, so it= was created in public schema.
The error message al= so says "public"...
//-------= -----------------------------------------------------------
ERROR: column "=EF=BB=BFrec_id" of relation "spec" does not exi= st
LINE 1: INSERT INTO "public"."spec" ("=EF=BB= =BFrec_id","title_c...
//-----------------------= -------------------------------------------

=
Output of the \d spec:
<= /span>


           =      Table "public.spec"
      &n= bsp;    Column           |  &n= bsp;       Type           | Mo= difiers 
----------------------------+---------------------= ----+-----------
 rec_id          =            | character varying(32)  &nbs= p;| not null
 title_category        &nb= sp;    | character varying(255)  | 
 do= ctype                    = | character varying(255)  | 
 ... goes on like th= is for other columns.

What are you trying to see= in the output of \d spec?

I don't understand wh= at you mean by the import code is trying to insert in to wrong version of t= he table.
I visually checked the left side "menu like" structure= of the phpPgAdmin- there is no other table of that name.

=
You mentioned that quoted identifiers are not the issue.
<= div style=3D"font-family: "MS PGothic", sans-serif; font-size: 12= pt;">This prompted me to test the process in a table with a few columns and= ascii characters.
Immediately it was clear that quoted identifiers were not to blame.

I found that I got that error when I change encoding of t= he tab delimited file to UTF-8. 
Because my data contains non-ascii characters, if I don't use= UTF-8, I get this error.
ERROR:  invalid byte sequence=
 for encoding "UTF8": 0x82

... and = I read somewhere that if I open the text file in notpad and save it with UT= F-8 encoding, I can get rid of the error. (When inserting using pyDev (psyc= opg2)/Eclipse, that does get rid of the error...

That's why I changed encoding.

And now I am stu= ck with this error.

But at least, now I am not b= laming phpPgAdmin :)
Thanks for the lead. 

=
BTW, both server and client encoding of my pg db are UTF8.

testdb=3D# SHOW SERVER_ENC= ODING;
 server_encoding 
-----------------
 UTF8
(1= row)

testdb=3D# SHOW CLIENT= _ENCODING;
 client_encoding 
-----------------
 UTF8
(1 row)

testdb=3D#


----- Original Message -----
= From: Adrian Klaver <adrian= .klaver@aklaver.com>
To: s400t@yahoo.co.jp; rob stone <floriparob@gmail.com&= gt;; "pgsql-general@lists.postgresql.org" <pgsql-general@lists.postgresq= l.org>
Date: 2018/12/7, Fri 23:47
Subject: Re: Importing tab delimited= text file using phpPgAdmin 5.1 GUI

On 12/7/18 12:28 AM, s400t@yahoo.co.jp wrote:
> H= ello Adrian, Rob!
>
> Thank you for the comments.
>
= > Oh, yes, I forgot to mention that I am using Postgresql version 9.6.> I had read somewhere that last supported version was 9.3 or somethin= g,
> could be 9.2 as you say.
>
> I wanted to use phpPg= Admin, that's why I went back to 9.6 even if I had
> installed ver. = 10 first.
> But if the phpPgAdmin quotes identifiers by defaults, I w= ill need to
> look for some other ways.

I don't think the quo= ted identifiers are the issue. I am suspecting that
the import code may= be trying to INSERT into the wrong version of the
table. Some question= s:

1) Which schema did you create spec in?

2) In psql what do= es \d spec show?


>
> Strictly speaking, I don't need t= o use the phpPgAdmin, but I am trying
> to find a GUI way to upload = a file quickly (the file has thousands of
> records.)
>
&g= t; Now, I am using pyDev in Eclipse to insert records, but I need to use a =
> web-based click and upload.

?
https://www.pgadmin.org/

>
= > If I could find a php version of my python code that would be great!> My Python code:
>
> cur =3D conn.cursor()
>
&= gt; with io.open(fileName,'r',encoding=3D'utf8') as f:
>   =   next(f)  # Skip header row.
>      cur.co= py_from(f, tableName, sep=3D'\t')
> conn.commit()
> cur.close()=
> f.close()
>
>
> I have found PHP samples for l= ine by line read and insert, but that will
> be too slow for me.
= >
> Cheers!
>
>
>
>    ----= - Original Message -----
>    *From:* rob stone <f= loriparob@gmail.com>
>    *To:* Adrian Klaver <<= a ymailto=3D"mailto:adrian.klaver@aklaver.com" href=3D"mailto:adrian.klaver= @aklaver.com">adrian.klaver@aklaver.com>; s400t@yahoo.co.jp;
&= gt;    "pgsql-general@lists.pos= tgresql.org"
>    <pgsql-general@lists.postgresql.org>
>    *Date:* 2= 018/12/7, Fri 16:47
>    *Subject:* Re: Importing tab deli= mited text file using phpPgAdmin
>    5.1 GUI
>
= >    Hello,
>
>    On Thu, 2018-12-06= at 21:29 -0800, Adrian Klaver wrote:
>      > On 1= 2/6/18 7:54 PM, s400t@yahoo.co.jp <mailto:s400t@yahoo.co.jp>>    wrote:
>      >
>  &= nbsp;   > Most GUI tools I am familiar with quote identifiers by de= fault.
>      > > How/where can I tell the phpPg= Admin not to add that extra "" around
>      > >= the
>      > > field name?
>   =   >
>      > I don't know. I have been und= er the impression that phpPgAdmin was
>      > no>      > longer maintained/in use.
>  &nb= sp;   >
>      > You might have more luck h= ere:
>      >
>      > https://sourceforge.net/p/phppgadmin/discussion/115884
>&n= bsp;     >
>      > >
> =     > > Thanks for reading and suggestions.
>  =     >
>      >
>
>  =   If you look at phppgadmin on sourceforge, the tarball files are all=
>    dated April 15th., 2013.
>    It ap= pears to have stalled at Postgres version 9.2.
>    I doub= t if it will run on versions 10 or 11.
>
>    Cheer= s,
>    Rob
>
>
>
>
> >


--
Adrian Klaver
adrian.klaver@akl= aver.com


=
------=_Part_269175_2064096532.1544202278510--