#Can't run sql query trying to create a postgreSQL Database
44 messages · Page 1 of 1 (latest)
4b8c2a06-3558-485f-a3a2-ea8afa7e9787
that is absolutely not a valid query
now im doing it one by one and it running okay
until this line
COPY public.categorias (id_categoria, nombre) FROM stdin; 1 Dormitorio 2 Comedor 3 Cocina 4 Oficina 5 Living 6 Infantil - syntax error at or near "1"
COPY public.categorias (id_categoria, nombre) FROM stdin;
1 Dormitorio
2 Comedor
3 Cocina
4 Oficina
5 Living
6 Infantil
.
this is the error
im pastingit from my sql file so i dont undertaand whatsa wrong?
that's not a valid query either
why?
im taking it from the query that was made automatically by doing a backup from postgresql
you want to to use pg_restore
what do you mean?
ahhhh yes!! is did a dump
so the dump generated me an script with the full query
So now i need to do a restore in the query?
did you use pg_dump?
?
Yes
then use pg_restore
no, it restore the database from the dump
^
read please
okay, cool i will check it now thanks for the help 😉
pg_restore -U <Username> -d <database_name> <file_path>.sql
is this correct doing it from my pc?
DATABASE_URL
PGDATABASE = database_name?
PGHOST
PGPASSWORD
PGPORT
PGUSER = Username?
C:\Program Files\PostgreSQL\15\bin>pg_restore -U postgres -d railway mueblesmayo.sql
pg_restore: error: input file does not appear to be a valid archiver