[Gambas-user] Q:how to save a file.png into Postgresql [solved]

richard terry rterry at ...1946...
Thu Sep 4 05:16:42 CEST 2008


On Wed, 3 Sep 2008 07:51:03 pm Ron_1st wrote:

Finally solved.

I did try and try inserting the E in the hint, but put in inside the qotes and 
not outside it so this works:

insert into  Insert into clin_consult.temp_image(piccie) values
(E'\\211PNG\\015\\012\\032\\012\\....')

Thanks to everyone who helped. Syan mailed my via the postgres novice list. I 
never could intrepret documentation very well.

Regards

Richard

>
> On Wednesday 03 September 2008, richard terry wrote:
> > On Tue, 2 Sep 2008 09:48:55 pm you wrote:
> > Ok, that got me a bit further: This is the resultant (failed) insert
> > query . First try using $$ as the delimiters as per my code gives this
> > and fails:
> >
> > insert into
> > clin_consult.temp_image(piccie)values($$\\211PNG\\015\\012......
>
> ---8<-----
>
> > \\251\\370\\003>\\241\\324n\\304~\\303\\331\\000\\000\\000\\000IEND\\256B
> >`\\202') WARNING:  nonstandard use of \\ in a string literal
> > LINE 1: insert into clin_consult.temp_image(piccie)values('\\211PNG\...
> >                                 ^
> > HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
> >
> >
> > Perhaps someone can understand this and help
> >
> > Regards
> >
> > Richard
>
> In mysql like syntax the command would be
>
> > LINE 1: insert into clin_consult.temp_image(piccie)values('\\211PNG\...
> >                                  ^
>
> The ^ is at the position where th error is.
> Is the field  temp_image existing?
> Is the _ also allowed in field names as it looks allowed in table names?
>
> What is your field an table name and are they following the syntax rules
> of posgresql, the database system you use, as I rememeber well?
>
>
>
> Just reading what I typed I see clin_consult.temp_image(piccie) (values)
>
> Do you mean the field -=- clin_consult.temp_image -=- in table -=- piccies
> -=- or the table -=- clin_consult.temp_image -=- in filed -=- piccies -=-
> ?????
>
>
>
> Should the fieldname not be surrond with quotes while a dot in the
> name in most caases is not allowed.
> As far I know the only safe are just only alphanummeric and underscore
> and a name as -=- clin_consult.temp_image -=- looks to me as invalid
> without qoutes surrounding this name constuction.
>
> Try to add a field as 'myfiled' in the table and insert into that filed.
> to find out you current fieldname is a invalid field name.Best regards
>
>
> Ron_1st






More information about the User mailing list