Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
1
votes
1
answers
494
views
Postgres psql command intermittently 'stalls' in powershell
I'm in the process of moving a postgres database to a new server. I have number of large tables, partitioned by month, each contains several 10's of millions of rows. I have a powershell script to do the following.... - Copy the backup file (for a single partition) from archive location (using roboc...
I'm in the process of moving a postgres database to a new server.
I have number of large tables, partitioned by month, each contains several 10's of millions of rows.
I have a powershell script to do the following....
- Copy the backup file (for a single partition) from archive location
(using robocopy)
- load the file back into the database using psql.
- drop the backup file.
- loop back to the beginning and move onto the
next partition.
Copying the file from the archive takes maybe 10 minutes, loading it typically 40 minutes, then it moves onto the next partition. **The problem** is that the PowerShell console seems to occasionally get 'stuck' after loading a partition. Occasionally, a partition seems to be taking too long (say an hour) I check the windows task manager, and none of the processes seem to be doing anything. I check the dashboard in pgAdmin4 (no locks, most sessions idle). Then I check the record count for the partition being loaded - the record count seems to be static (still the same 5 minutes later). So as far as I can tell the partition has been loaded successfully, and the database is mostly idle. But the powershell console that's running the load session hasn't changed, then I shift focus to the powershell console, press return a couple of times and suddenly it bursts into life. The console tells me it's moved onto the partition, the task-manager indicates that the powershell process and postgres process are now running again, pgAdmin4 also indicates the database has sprung back into life.
The powershell script logs to screen using
Write-host
and the current time between each step, so I always know what the most recent step was. My conclusion is that the interaction between powershell and psql is somehow 'broken' - powershell hasn't worked out that psql has finished and doesn't know to move onto the next step.
Other info - there's no sign of any errors (that I can spot) all the tables seem to get populated correctly (eventually) and the script works fine on all the smaller partitions. This only happens on about 1 partition in 10, the only cure seems to be pressing enter a couple of times.
This isn't a critical problem, occasionally hitting enter a couple of times is a viable solution, but an understanding of what might be going on (or even a solution) would be much appreciated.
ConanTheGerbil
(1303 rep)
Feb 20, 2022, 12:03 PM
• Last activity: Jul 13, 2025, 10:03 PM
0
votes
1
answers
906
views
Could not Access File $libdir/vector No Such File or Directory
I am not a DBA. I am trying to test and experiment. I am on a Windows 11 machine and using PgAdmin. I have PostgreSQL 15 installed. When I run CREATE EXTENSION VECTOR, I get the following error message: Could not access file "$libdir/vector": No such file or directory How can I find out where "$libd...
I am not a DBA. I am trying to test and experiment.
I am on a Windows 11 machine and using PgAdmin. I have PostgreSQL 15 installed.
When I run CREATE EXTENSION VECTOR, I get the following error message:
Could not access file "$libdir/vector": No such file or directory
How can I find out where "$libdir" is pointing to?
**Edit #1:**
Here is what I used to install PGVector:
https://github.com/pgvector/pgvector#windows
**Edit # 2:**
Based on comments below, I thought $libdir was being set by PGRoot, but when I added a vector directory to

C:\Program Files\PostgreSQL\15
directory, the same error message came up.
Chicken Sandwich No Pickles
(117 rep)
Nov 21, 2024, 05:42 PM
• Last activity: Mar 29, 2025, 06:29 AM
0
votes
0
answers
181
views
Windows could not start the SQl server (SQLEXPRESS) service on Local Computer (MacOS running Windows 11 VM)
I have a common problem that I just cannot figure out after scrolling through posts expressing a similar issue. I am currently running a macOS using a virtual machine that has Windows 11. Due to what I understand are compatibility issues in the CPU architecture, I downloaded SQL Server 2019 Localdb....
I have a common problem that I just cannot figure out after scrolling through posts expressing a similar issue. I am currently running a macOS using a virtual machine that has Windows 11. Due to what I understand are compatibility issues in the CPU architecture, I downloaded SQL Server 2019 Localdb. When I try to connect to the server, I run into the exact issue this post described:
https://stackoverflow.com/questions/41035516/sql-server-cant-start-to-connect
My guess is that the issue is stemming from the fact that SQL Server (SQLEXPRESS) is stopped in SQL Server Configuration Manager, but when I try to right click and start, I get this message:
I suspect as well that the absence of startup parameters might be relevant:
I corrected this issue by going to the Registry Editor and added the strings manually:
They were added successfully in the Configuration Manager:
But, when I try to start the service, I get the same error message as above saying that my request failed (Event ID: 17058), but this time the issue is I get an Access Denied:
initerrlog: Could not open error log file ‘c:\Program Files\Microsoft SQL Server\MSSQL15.SQLEXPRESS\MSSQL\Log\ERRORLOG’. Operating system error = 5(Access is denied).
I am wondering whether my adding those parameters manually is a problem? It seems that the .mdf and .ldf are files that I don't have?
Any help would be much appreciated.




Meditation
(1 rep)
Dec 18, 2024, 04:25 PM
• Last activity: Jan 3, 2025, 12:38 PM
0
votes
0
answers
199
views
MariaDB 11.1.2-GA on Windows 11 Pro crashes every couple of days, sometimes couple of hours
Is there any **current** (October 2023) solution for MariaDB 11.1.2-GA on Windows 11 Pro crashing every couple of days or even sometimes every couple of hours with the following error in .err log: InnoDB: Missing FILE_CREATE, FILE_DELETE or FILE_MODIFY before FILE_CHECKPOINT I am asking for _current...
Is there any **current** (October 2023) solution for MariaDB 11.1.2-GA on Windows 11 Pro crashing every couple of days or even sometimes every couple of hours with the following error in .err log:
InnoDB: Missing FILE_CREATE, FILE_DELETE or FILE_MODIFY before FILE_CHECKPOINT
I am asking for _current_ report on this problem (or solution the best), because [every report](https://dba.stackexchange.com/a/315009/35230) that I [have found](https://jira.mariadb.org/browse/MDEV-28870) says that [this is an old bug](https://jira.mariadb.org/browse/MDEV-31410) that was supposedly resolved [long time ago](https://jira.mariadb.org/browse/MDEV-28976) . Which turns out to be not true.
Every DBA question, JIRA ticket or blog entry says that this was fixed in 10.7.5 and yet it happens in 11.1.2-GA again. And I can't find any report on any kind of regression. Of course, I cannot find any solution as well, hence this question.
Things I have tried so far:
1. Setting
innodb_force_recovery
on any value ([here](https://stackoverflow.com/a/61744085/1469208) or [here](https://stackoverflow.com/a/43247919/1469208) or [here](https://dba.stackexchange.com/a/318218/35230)) doesn't work and still causes mysqld
to quit with the above error
2. Deleting _ib_logfile0_ ([here](https://stackoverflow.com/a/61187808/1469208) or [here](https://dba.stackexchange.com/a/322902/35230)) doesn't work. MariaDB dies with error that this file is missing instead of recreating it, as said
3. [Setting innodb_log_file_size = 48M
](https://stackoverflow.com/a/39091569/1469208) doesn't help. I already had it said to this value. I didn't [tried to set it to 1000M
](https://stackoverflow.com/a/48577605/1469208) , but that sounds like an overkill.
4. [Setting innodb_buffer_pool_size = 10M
](https://stackoverflow.com/a/29556491/1469208) doesn't work as well. I already had it said to this value
[Deleting my corrupted files](https://dba.stackexchange.com/a/320759/35230) is the only solution that I have found working:
1. Rename _c:\\[path]\data_ into _c:\\[path]\data2_
2. Execute mysqld
(usually dies, but recreates files in _c:\\[path]\data_)
3. Overwrite all files in _c:\\[path]\data2_ with recreated copies from _c:\\[path]\data_
4. Delete _c:\\[path]\data_
5. Rename _c:\\[path]\data2_ into _c:\\[path]\data_
6. Execute mysqld
At this points MariaDB starts and stops normally, but of course the entire dataset is **not** correct, because such bluntly performed copy process isn't any backup-restore process at all. Everything must be recreated manually, i.e.:
- Access to phpMyAdmin, including all it's tables and settings
- All users, passwords, privileges using PMA
- All data tables by SQL import
Usually takes an hour or two. And then, after couple of hours or days at most, data gets corrupted again, and the whole story starts from the beginning.
This is my private laptop, my dev environment. I am the only person using it and PHP running my application is the only process writing to MariaDB. So by no mean we can say anything about some race conditions that are mentioned in MariaDB's JIRA tickets.
trejder
(101 rep)
Oct 23, 2023, 04:18 PM
1
votes
0
answers
22
views
New WS install win11 Pro and O365: Connection to DB fails due to change in ownership from SQL to Azure. Is it a Permissions issue?
Security System: Unable to connect to Local Database Template[![enter image description here][1]][1]. Error Message: The remote computer that you are trying to connect to requires Network Level Authentication (NLA), but your Windows domain controller cannot be contacted to perform NLA. [1]: https://...
Security System: Unable to connect to Local Database Template
.
Error Message: The remote computer that you are trying to connect to requires Network Level Authentication (NLA), but your Windows domain controller cannot be contacted to perform NLA.

Dragonfly
(11 rep)
Jul 5, 2023, 10:45 PM
0
votes
0
answers
44
views
How much space required to merge two tables?
I have some large sets of tables that I partition by date. Every day I run a query similar to this to merge the two tables WITH moved_rows AS ( DELETE FROM tableA_20230531 RETURNING * ) INSERT INTO tableA_202305 SELECT * FROM moved_rows The table called `tableA_20230531` contains all my data for 1 d...
I have some large sets of tables that I partition by date.
Every day I run a query similar to this to merge the two tables
WITH moved_rows AS
(
DELETE FROM tableA_20230531 RETURNING *
)
INSERT INTO tableA_202305
SELECT * FROM moved_rows
The table called
tableA_20230531
contains all my data for 1 day - averages about 1Gbyte. The table
tableA_202305
contains the data for the month so far, obviously this gets bigger as the month progresses.
Sometimes the query falls due to lack of space (**ERROR: 53100: could not extend file.... No space left on device** ).
I know how large the two tables are, and I know how much free space I have on the disk.
Is there any way of working out (before running) if I have enough space for the query to execute successfully?
Somedays it will happily work even if the available freespace is less than the size of the daily table.
Otherdays it will fail even with freespace more than twice the size of the daily table.
(no other users connected when this is running, whole database on same disk, one index, about 10% of the table size - an additional 100Mbyte per day.
Archiving, replication and checkpointing all left to original, as-installed default settings - that's my of saying I don't know!)
ConanTheGerbil
(1303 rep)
Jun 6, 2023, 10:48 AM
• Last activity: Jun 6, 2023, 05:56 PM
0
votes
0
answers
706
views
I can't install "SQL Server 2019" in windows 11. Getting error 0x84B40002
I can't install "SQL Server 2019" in windows 11. Getting error 0x84B40002 stating Database service engine failed.
I can't install "SQL Server 2019" in windows 11. Getting error 0x84B40002 stating Database service engine failed.
Mansi Rani
(1 rep)
Dec 20, 2022, 11:07 AM
Showing page 1 of 7 total questions