K
K
Kenny002020-12-08 11:12:57
PostgreSQL
Kenny00, 2020-12-08 11:12:57

Why is the database created through psql not suitable for use in 1C?

After creating a 1C database in psql, when trying to add a database to a cluster, an error message appears that:
DATABASE is not suitable for use
4evkgrgrp-6g6rjbi0cdbv4izx0.png
Created a database in 2 ways:

-- Database: MyTest

-- DROP DATABASE "MyTest";

CREATE DATABASE "MyTest"
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'ru_RU.UTF-8'
LC_CTYPE = 'ru_RU.UTF-8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
\q

and
CREATE DATABASE MyTest WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'ru_RU.UTF-8' LC_CTYPE = 'ru_RU.UTF-8';

Why does 1C not allow you to work with such an empty base?
What is the minimum set in the database should be, for a "suitable" environment?

Of course, if you create an empty database through the cluster console or 1C itself, and upload the dump to sql and then upload it to the desired server, everything works, but a bunch of objects are created there, are they all needed?

pg_dump -C -h localhost -U postgres usos_test > MyTest.sql

-- DROP DATABASE "MyTest";

CREATE DATABASE "MyTest"
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'ru_RU.UTF-8'
LC_CTYPE = 'ru_RU.UTF-8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
\q

psql -h remote.app.serv01 -U postgres --single-transaction < MyTest.sql

Is it generally possible to create empty databases using PostgreSQL?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mikhail E, 2020-12-08
@Kenny00

Manually, bases for 1C are usually not created for several reasons.
One of the main ones is the structure of tables (including the names of fields and tables) should be exactly how 1C plans to use it. (The names of the tables will be written in accordance, in a separate table)
Also, after creation, this database structure should be in the def. as binary data in several "Service Tables", which is extremely problematic to recreate exactly.
If you have a desire to create databases with a script, the easiest way is to create a "dummy" from 1C, create a backup, and then deploy it where you need.
ZY: even an empty database created from 1C, in fact, will not be empty, it will contain a lot of service data. That is why your database gave an error when connecting to the cluster (not found, service data in service tables)

M
Mikhail Krostelev, 2020-12-08
@twistfire92

Create an empty server database in 1C, specify "create a database if it does not exist" and see what an "empty" 1C database looks like in postgre.

K
ky0, 2020-12-08
@ky0

Yes, 1C uses postgres in a particularly perverted form. It’s better not to get into this set of weights and counterweights once again with your hands ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question