Garbage character inserted at the beginning of every SQL file on OSX

Lists: pgadmin-support
From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: Garbage character inserted at the beginning of every SQL file on OSX
Date: 2010-02-17 22:38:13
Message-ID: 4B7C6FD5.2050201@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

All,

Version: 1.10.1
Platform: OSX 10.5
Installed From: .dmg
Severity: Major
Reproduceable: Always
Description:
Every time I create a new SQL file using the SQL editor in pgAdmin, it
inserts a non-ASCII garbage character at the very beginning of the file.
This then prevents the file from running, say through psql.

Sometimes it also inserts the character when I edit an existing file,
but not always. I haven't discerned a pattern here.

The character cannot be viewed in emacs, but can be deleted. This issue
is completely prohibitive of using the SQL editor in any kind of shared
system.

--Josh Berkus


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Garbage character inserted at the beginning of every SQL file on OSX
Date: 2010-02-17 22:44:04
Message-ID: 937d27e11002171444p12824604ye254bc666ccdc337@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

On Wed, Feb 17, 2010 at 10:38 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
> All,
>
> Version: 1.10.1
> Platform: OSX 10.5
> Installed From: .dmg
> Severity: Major
> Reproduceable: Always
> Description:
> Every time I create a new SQL file using the SQL editor in pgAdmin, it
> inserts a non-ASCII garbage character at the very beginning of the file.
>  This then prevents the file from running, say through psql.
>
> Sometimes it also inserts the character when I edit an existing file,
> but not always.  I haven't discerned a pattern here.
>
> The character cannot be viewed in emacs, but can be deleted.  This issue
> is completely prohibitive of using the SQL editor in any kind of shared
> system.

It's not garbage, it's a Unicode BOM.

If your other software cannot read Unicode files properly, you can
turn off Unicode file writing under File -> Options.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Garbage character inserted at the beginning of every SQL file on OSX
Date: 2010-02-17 22:52:03
Message-ID: 4B7C7313.3040601@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support


> It's not garbage, it's a Unicode BOM.
>
> If your other software cannot read Unicode files properly, you can
> turn off Unicode file writing under File -> Options.

psql is apparently unhappy with the BOM.

Thanks, I'll let you know if that fixes the issue; if it does, that
should go in the FAQ.

--Josh Berkus


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Garbage character inserted at the beginning of every SQL file on OSX
Date: 2010-02-18 21:06:58
Message-ID: 4B7DABF2.4020705@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

On 2/17/10 2:52 PM, Josh Berkus wrote:
>> It's not garbage, it's a Unicode BOM.
>>
>> If your other software cannot read Unicode files properly, you can
>> turn off Unicode file writing under File -> Options.
>
> psql is apparently unhappy with the BOM.
>
> Thanks, I'll let you know if that fixes the issue; if it does, that
> should go in the FAQ.

This appears to fix the problem. I suggest the following FAQ item:

Q: Why do I get "Error On Line 1" trying to load SQL files created with
pgAdmin using psql or other command-line tools?

A: The command-line tools you are using are not unicode-friendly, or are
not configured to be. You should turn off Unicode in the pgAdmin
preferences for the Editor.

--Josh Berkus


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Garbage character inserted at the beginning of every SQL file on OSX
Date: 2010-02-18 21:20:24
Message-ID: 937d27e11002181320n59c74e17xdfaae21d7c01808a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

On Thu, Feb 18, 2010 at 9:06 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
> On 2/17/10 2:52 PM, Josh Berkus wrote:
>>> It's not garbage, it's a Unicode BOM.
>>>
>>> If your other software cannot read Unicode files properly, you can
>>> turn off Unicode file writing under File -> Options.
>>
>> psql is apparently unhappy with the BOM.
>>
>> Thanks, I'll let you know if that fixes the issue; if it does, that
>> should go in the FAQ.
>
> This appears to fix the problem.  I suggest the following FAQ item:
>
> Q: Why do I get "Error On Line 1" trying to load SQL files created with
> pgAdmin using psql or other command-line tools?
>
> A: The command-line tools you are using are not unicode-friendly, or are
> not configured to be.  You should turn off Unicode in the pgAdmin
> preferences for the Editor.

Inclusion on the FAQ would imply that this is a frequently asked
question - which it most certainly isn't.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Garbage character inserted at the beginning of every SQL file on OSX
Date: 2010-02-18 21:52:45
Message-ID: 4B7DB6AD.9070901@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

On 2/18/10 1:20 PM, Dave Page wrote:
> On Thu, Feb 18, 2010 at 9:06 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
>> On 2/17/10 2:52 PM, Josh Berkus wrote:
>>>> It's not garbage, it's a Unicode BOM.
>>>>
>>>> If your other software cannot read Unicode files properly, you can
>>>> turn off Unicode file writing under File -> Options.
>>> psql is apparently unhappy with the BOM.
>>>
>>> Thanks, I'll let you know if that fixes the issue; if it does, that
>>> should go in the FAQ.
>> This appears to fix the problem. I suggest the following FAQ item:
>>
>> Q: Why do I get "Error On Line 1" trying to load SQL files created with
>> pgAdmin using psql or other command-line tools?
>>
>> A: The command-line tools you are using are not unicode-friendly, or are
>> not configured to be. You should turn off Unicode in the pgAdmin
>> preferences for the Editor.
>
> Inclusion on the FAQ would imply that this is a frequently asked
> question - which it most certainly isn't.

Well, now it's in the list archives at least.

--Josh Berkus


From: Dave Page <dpage(at)pgadmin(dot)org>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Garbage character inserted at the beginning of every SQL file on OSX
Date: 2010-02-18 21:53:25
Message-ID: 937d27e11002181353lca6447ve3e7e86767d0fafc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-support

On Thu, Feb 18, 2010 at 9:52 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
> On 2/18/10 1:20 PM, Dave Page wrote:
>> On Thu, Feb 18, 2010 at 9:06 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
>>> On 2/17/10 2:52 PM, Josh Berkus wrote:
>>>>> It's not garbage, it's a Unicode BOM.
>>>>>
>>>>> If your other software cannot read Unicode files properly, you can
>>>>> turn off Unicode file writing under File -> Options.
>>>> psql is apparently unhappy with the BOM.
>>>>
>>>> Thanks, I'll let you know if that fixes the issue; if it does, that
>>>> should go in the FAQ.
>>> This appears to fix the problem.  I suggest the following FAQ item:
>>>
>>> Q: Why do I get "Error On Line 1" trying to load SQL files created with
>>> pgAdmin using psql or other command-line tools?
>>>
>>> A: The command-line tools you are using are not unicode-friendly, or are
>>> not configured to be.  You should turn off Unicode in the pgAdmin
>>> preferences for the Editor.
>>
>> Inclusion on the FAQ would imply that this is a frequently asked
>> question - which it most certainly isn't.
>
> Well, now it's in the list archives at least.

Yup :-)

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com