pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_update and encoding
3+ messages / 2 participants
[nested] [flat]

* pg_update and encoding
@ 2023-09-12 11:49  Graeme <graeme@gemmill.name>
  0 siblings, 1 reply; 3+ messages in thread

From: Graeme @ 2023-09-12 11:49 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Preparing to use pg_update, I used initdb to create the new pgsql/data, 
but pg_update has exited with

encodings for database "template1" do not match:  old "UTF8", new 
"SQL_ASCII"

Should I delete pgsql/data and re-create with initdb -E "UTF8"?

Thanks,

Graeme

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

* Re: pg_update and encoding
@ 2023-09-12 14:52  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Graeme <graeme@gemmill.name>
  0 siblings, 1 reply; 3+ messages in thread

From: Adrian Klaver @ 2023-09-12 14:52 UTC (permalink / raw)
  To: Graeme <graeme@gemmill.name>; pgsql-general@lists.postgresql.org

On 9/12/23 04:49, Graeme wrote:
> Preparing to use pg_update, I used initdb to create the new pgsql/data, 
> but pg_update has exited with

I'm guessing that is actually pg_upgrade:

https://www.postgresql.org/docs/current/pgupgrade.html

> 
> encodings for database "template1" do not match:  old "UTF8", new 
> "SQL_ASCII"
> 
> Should I delete pgsql/data and re-create with initdb -E "UTF8"?

Yes for two reasons:

1) The upgrade will not happen.

2) From here:

https://www.postgresql.org/docs/current/multibyte.html

"The SQL_ASCII setting behaves considerably differently from the other 
settings. When the server character set is SQL_ASCII, the server 
interprets byte values 0–127 according to the ASCII standard, while byte 
values 128–255 are taken as uninterpreted characters. No encoding 
conversion will be done when the setting is SQL_ASCII. Thus, this 
setting is not so much a declaration that a specific encoding is in use, 
as a declaration of ignorance about the encoding. In most cases, if you 
are working with any non-ASCII data, it is unwise to use the SQL_ASCII 
setting because PostgreSQL will be unable to help you by converting or 
validating non-ASCII characters."

> 
> Thanks,
> 
> Graeme
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com






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

* Re: pg_update and encoding
@ 2023-09-12 14:56  Graeme <graeme@gemmill.name>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Graeme @ 2023-09-12 14:56 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general@lists.postgresql.org

On 12/09/2023 15:52, Adrian Klaver wrote:
> On 9/12/23 04:49, Graeme wrote:
>> Preparing to use pg_update, I used initdb to create the new 
>> pgsql/data, but pg_update has exited with
>
> I'm guessing that is actually pg_upgrade:
>
> https://www.postgresql.org/docs/current/pgupgrade.html
>
>>
>> encodings for database "template1" do not match:  old "UTF8", new 
>> "SQL_ASCII"
>>
>> Should I delete pgsql/data and re-create with initdb -E "UTF8"?
>
> Yes for two reasons:
>
> 1) The upgrade will not happen.
>
> 2) From here:
>
> https://www.postgresql.org/docs/current/multibyte.html
>
> "The SQL_ASCII setting behaves considerably differently from the other 
> settings. When the server character set is SQL_ASCII, the server 
> interprets byte values 0–127 according to the ASCII standard, while 
> byte values 128–255 are taken as uninterpreted characters. No encoding 
> conversion will be done when the setting is SQL_ASCII. Thus, this 
> setting is not so much a declaration that a specific encoding is in 
> use, as a declaration of ignorance about the encoding. In most cases, 
> if you are working with any non-ASCII data, it is unwise to use the 
> SQL_ASCII setting because PostgreSQL will be unable to help you by 
> converting or validating non-ASCII characters."
>
>>
>> Thanks,
>>
>> Graeme
>>
>
Thanks, done. Data now accessible

Graeme






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


end of thread, other threads:[~2023-09-12 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-09-12 11:49 pg_update and encoding Graeme <graeme@gemmill.name>
2023-09-12 14:52 ` Adrian Klaver <adrian.klaver@aklaver.com>
2023-09-12 14:56   ` Graeme <graeme@gemmill.name>

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