当前正在检查将Postgres从10.4升级到11.5的过程。
当我使用“ check”选项运行for i in range((len(**num**))):
chunk = num[i:i+13]
product = 1
#multiply together the individual numbers that make up
the chunk
for **num** in chunk: # This creates a new variable named "num"
# and discards the old variable stored in num
print(num)
product *= int(num)
时,收到以下消息。如果您对此有任何评论,或者关于如何解决此问题,我将不胜感激。
for i in range((len(num))):
chunk = num[i:i+13]
product = 1
#multiply together the individual numbers that make up
the chunk
for j in chunk:
print(j)
product *= int(j)
答案 0 :(得分:1)
在initdb新服务器上时,需要将其设置为与旧服务器匹配。类似于其中之一:
initdb --locale C -D /var/lib/pgsql/11/data
pg_ctl initdb -o "--locale C" -D /var/lib/pgsql/11/data
LC_ALL=C initdb -D /var/lib/pgsql/11/data
答案 1 :(得分:0)
您需要使用与旧群集相同(可更改)的编码来创建新群集:
initdb -E SQL_ASCII --locale=C /new/data/directory
答案 2 :(得分:0)
@jjanes,劳伦兹·阿尔贝
谢谢您的评论,根据文件我第一次还是听不懂
我试图执行以下命令:#/usr/pgsql-11/bin/postgresql-11-setup initdb --locale=C -D /var/lib/pgsql/11/data
但是它正在下降,那么我已经按照您的建议执行了该命令,并且验证已成功完成:/usr/pgsql-11/bin/initdb --locale=C -D /var/lib/pgsql/11/data
-bash-4.2$ /usr/pgsql-11/bin/pg_upgrade \
> -b /usr/pgsql-10/bin \
> -B /usr/pgsql-11/bin \
> -d /var/lib/pgsql/10/data \
> -D /var/lib/pgsql/11/data \
> -c pgsql-10/ pgsql-11/
Performing Consistency Checks on Old Live Server
------------------------------------------------
Checking cluster versions ok
Checking database user is the install user ok
Checking database connection settings ok
Checking for prepared transactions ok
Checking for reg* data types in user tables ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for presence of required libraries ok
Checking database user is the install user ok
Checking for prepared transactions ok
*Clusters are compatible*
现在,我还有第二个问题,是否可以从源postgres DB中更改编码?如果我决定仅避免这种情况并默认情况下继续使用SQL_ASCII,它将以哪种方式影响?