From oliveiros.cristina@marktest.pt Wed Sep 9 11:10:48 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 8F3BD6381DB for ; Wed, 9 Sep 2009 08:10:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 40861-05 for ; Wed, 9 Sep 2009 11:10:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from jupiter.marktest.pt (delta.marktest.pt [80.251.174.116]) by mail.postgresql.org (Postfix) with ESMTP id 80587636C1F for ; Wed, 9 Sep 2009 08:10:37 -0300 (ADT) Received: from Proteu (proteu.marktest.pt [10.61.90.54]) by jupiter.marktest.pt with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 38M9802V; Wed, 9 Sep 2009 12:10:33 +0100 Message-ID: <164F217AD1FE44F0B6D4CE0AE7369D54@marktestcr.marktest.pt> From: "Oliveiros C," To: Subject: Differences between bit string constant sintax Date: Wed, 9 Sep 2009 12:10:29 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_013B_01CA3146.85B62920" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=-10 required=5 tests=AWL=-0.000, BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200909/36 X-Sequence-Number: 33101 This is a multi-part message in MIME format. ------=_NextPart_000_013B_01CA3146.85B62920 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear All, I have a table which has a field that is of type bit varying. When I do a direct INSERT with , say, X'1F', everything works fine. But in this table I have to insert several tens of thousands of records each time, so I decided to use COPY command. And if I build a file like this (columns separated by tab char) primary_key1 X'1F' primary_key2 X'1FF' ... The system will complain on the first line, saying that ' is not an hexadecimal digit. I tried to remove the single quotes and it worked fine... With values like this : X1F, X1FF, etc Is the system supposed to behave like this, or have I gone sideways somewhere on this? My copy command is just this : COPY t_unique_browsers=20 ("IDUniqueBrowsers","browsersSet")=20 FROM $file$C:\temp\pg\totalAccount.sql$file$; Also, SELECT version() says : "PostgreSQL 8.3.7, compiled by Visual C++ build 1400" Thanx in advance for your help Best, Oliveiros ------=_NextPart_000_013B_01CA3146.85B62920 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear All,
 
I have a table which has a field that = is of type=20 bit varying.
 
When I do a direct INSERT with , say, = X'1F',=20 everything
works fine.
 
But in this table I have to insert = several tens of=20 thousands
of records each time, so I decided to=20 use
COPY command.
 
And if I build a file like this = (columns separated=20 by tab char)
primary_key1    = X'1F'
primary_key2    = X'1FF'
...
 
The system will complain on the first=20 line,
saying that ' is not an hexadecimal=20 digit.
 
I tried to remove the single quotes and = it worked=20 fine...
With values like this : X1F, X1FF, = etc
 
Is the system supposed to behave like = this, or=20 have
I gone sideways somewhere on = this?
 
My copy command is just this = :
 
COPY t_unique_browsers=20
("IDUniqueBrowsers","browsersSet")
 FROM=20 $file$C:\temp\pg\totalAccount.sql$file$;
 
Also,
SELECT version() says :
"PostgreSQL 8.3.7, compiled by Visual = C++ build=20 1400"
 
Thanx in advance for your = help
 
Best,
Oliveiros
------=_NextPart_000_013B_01CA3146.85B62920-- From jasen@xnet.co.nz Thu Sep 10 09:26:01 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 7B8C26324D1 for ; Thu, 10 Sep 2009 06:26:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 53514-08 for ; Thu, 10 Sep 2009 09:25:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from titania.wxnz.net (titania.wxnz.net [58.28.4.13]) by mail.postgresql.org (Postfix) with ESMTP id C5DD0634875 for ; Thu, 10 Sep 2009 06:25:49 -0300 (ADT) Received: from gonzo (ip-118-90-133-82.xdsl.xnet.co.nz [118.90.133.82]) by titania.wxnz.net (Postfix) with ESMTP id 3B6BC1098141 for ; Thu, 10 Sep 2009 21:25:46 +1200 (NZST) Received: from news by gonzo with local (Exim 4.69) (envelope-from ) id 1MlfuV-0007Zo-DN for pgsql-sql@postgresql.org; Thu, 10 Sep 2009 21:25:47 +1200 To: pgsql-sql@postgresql.org Path: not-for-mail From: Jasen Betts Newsgroups: gmane.comp.db.postgresql.sql Subject: Re: Differences between bit string constant sintax Date: 10 Sep 2009 09:25:47 GMT Organization: Dis (not Dat) Organisation Lines: 26 Message-ID: References: <164F217AD1FE44F0B6D4CE0AE7369D54@marktestcr.marktest.pt> NNTP-Posting-Host: localhost Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reversiblemaps.ath.cx 1252574747 28870 127.0.0.1 (10 Sep 2009 09:25:47 GMT) X-Face: ?)Aw4rXwN5u0~$nqKj`xPz>xHCwgi^q+^?Ri*+R(&uv2=E1Q0Zk(>h!~o2ID@6{uf8s; a +M[5[U[QT7xFN%^gR"=tuJw%TXXR'Fp~W; (T"1(739R%m0Yyyv*gkGoPA.$b,D.w:z+<'"=-lVT?6 {T?=R^:W5g|E2#EhjKCa+nt":4b}dU7GYB*HBxn&Td$@f%.kl^:7X8rQWd[NTc"P"u6nkisze/Q; 8 "9Z{peQF,w)7UjV$c|RO/mQW/NMgWfr5*$-Z%u46"/00mx-,\R'fLPe.)^ User-Agent: slrn/pre1.0.0-2 (Linux) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.629 tagged_above=-10 required=5 tests=AWL=-0.630, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200909/39 X-Sequence-Number: 33104 On 2009-09-09, Oliveiros C, wrote: > This is a multi-part message in MIME format. > > ------=_NextPart_000_013B_01CA3146.85B62920 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > Dear All, > > I have a table which has a field that is of type bit varying. > > When I do a direct INSERT with , say, X'1F', everything > works fine. copy syntax differs from literal syntax in several ways (an obvious one is that tabs are allowed in literals) in this case you don't use quotes in the value. copy mytable from stdin; 4 xdeadbeef 5 x123 \.