pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Differences between bit string constant sintax
2+ messages / 2 participants
[nested] [flat]

* Differences between bit string constant sintax
@ 2009-09-09 11:10  Oliveiros C, <oliveiros.cristina@marktest.pt>
  0 siblings, 1 reply; 2+ messages in thread

From: Oliveiros C, @ 2009-09-09 11:10 UTC (permalink / raw)
  To: pgsql-sql

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 
("IDUniqueBrowsers","browsersSet") 
 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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Differences between bit string constant sintax
@ 2009-09-10 09:25  Jasen Betts <jasen@xnet.co.nz>
  parent: Oliveiros C, <oliveiros.cristina@marktest.pt>
  0 siblings, 0 replies; 2+ messages in thread

From: Jasen Betts @ 2009-09-10 09:25 UTC (permalink / raw)
  To: pgsql-sql

On 2009-09-09, Oliveiros C, <oliveiros.cristina@marktest.pt> 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
\.
 




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2009-09-10 09:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-09-09 11:10 Differences between bit string constant sintax Oliveiros C, <oliveiros.cristina@marktest.pt>
2009-09-10 09:25 ` Jasen Betts <jasen@xnet.co.nz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox