AWS RDS PostgreSQL - Indexes being dropped automatically shortly after creation - postgresql

I'm creating indexes via pgAdmin for my PostgreSQL database hosted via AWS RDS with the following command:
CREATE INDEX team_idx_teamid ON team ("teamId");
Which returns the response:
Query returned successfully in 1 secs 575 msec.
And it is displayed in pgAdmin UI:
After a few minutes it disappears. Looking at the event logs in AWS I see the following message:
2021-06-21 11:21:58 UTC:13.58.56.170(51704):[16657]:STATEMENT: DROP INDEX "team_idx_teamid"
I can't find anything related to why indexes are being dropped or cleaned up in my google searches. Anyone got any ideas of what is going on?
Many thanks

Related

Unable to get the list of queries in azure postgresql?

Pg_stats_actvity is used in pgadmin 4 but it give only current queries.
And also checked on azure portal for logs in server logs there can't see the logs for queries.
If anyone know help on this it is azure postgresql server.
Need Queries for one perticular database.
I tried below query in pgadmin 4
Select * from pg_stats_activity
It is azure postgresql single server i checked logs and diagnostics.
Also tried explain analyse.
Help me to get list of queries in postgresql database for perticular time interval
You have several options in Postgres to capture queries.
You've already found that pg_stats_activity shows active, running queries.
The pg_stat_statements extension will show aggregated information for query fingerprints.
The log_statement configuration will log queries that were sent to the database into your postgres.log. Use the log_line_prefix configuration to capture more details into the logs.
The pgaudit extension will capture queries that were executed on the database, with nicely formatted output for easy parsing or to send to log aggregation tools.
Here's an Azure doc that describes how to set these in the UI and how to view the resulting logs: https://learn.microsoft.com/en-us/azure/postgresql/single-server/concepts-server-logs.
In your case, setting log_statement to 'all' should be a good start.

AWS DMS Source MongoDB and Target RDS Postgres Full load not happening but ongoing replication happens

I created a DMS task:
Source - MongoDB
Target - RDS Postgres
I have successfully working pipelines with full load + Ongoing replication working.
But for some collections in my source mongo when I create Full load or Full load + Ongoing replication,
Task shows successfully completed and starts ongoing replication.
But Full load doesn't happens only schema gets created in postgres with 0 rows, and Ongoing replication starts.
CloudWatch shows no error even after detailed debug.
In our case it's because of wrong database name configuration in DMS mongoDB endpoint. The table creation and CDC still work, but full load fails.

AWS SCT error while connecting to PostgreSQL 13.4

I get the following error when trying to connect to postgres as a target using AWS SCT:
LOADER ERROR: Error executing 'load-contexts' query: org.postgresql.util.PSQLException: ERROR: relation "aws_oracle_context.context" does not exist'
It appears to occur on the LOADER step load-contexts
All steps for LOADER until that point executed successfully per the log file.
Why would it be looking for a relation that appears to be related to oracle?
Referenced relation triggering error: aws_oracle_context.context
Postgres RDS version: 13.4
AWS SCT version: 1.0.660
Postgres JDBC Driver: 42.3.3 and 42.2.19
Any ideas / insight would be appreciated!
It appears the fix is to un-check Server Level Objects completely for the PostgreSQL connection you create under the Servers drop-dwon on the right hand side of the SCT interface.
It's selected by default when you connect so the tool will always fail on that job step for PostgreSQL it seems. Other aspects of the tool seem to work fine.
If anyone has anymore insight into this, feel free to share!

How to View Full text of Top query in AWS RDS Postgres - performace insights

I'm using the Postgres database from AWS RDS. I want to see the full text of Top query in AWS RDS performance insights.
Link: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.UsingDashboard.html#USER_PerfInsights.UsingDashboard.SQLTextLimit
As per the documentation, I've updated the track_activity_query_size to the max: 102400, have also tried rebooting the Postgres DB instance, still, it shows the same truncated <= 500 chars.
PS: my Postgres DB instance version is 12.5
Can someone help?
You can enable the PostgresSQL logs and search the half length queries in the latest logs wherein you will get the full length queries of the same.
Go to the "Logs & events" tab in the respective database from RDS console and download the log. Then search using some file editor to get the full length queries.

Access Postgres table data files in RDS Aurora Postgres

I would like to find the date for the most latest changes on a postgres table . I see understand that we can get this info from accessing table data files. But my postgres database is hosted as AWS RDS aurora (Postgres database engine) . I guess we cant access the internals of RDS , how do i get this info , any help would be appreciated.
That is futile, even if you could get the files from Amazon, which you cannot.
The data files are also modified if no DML operation is going on: both autovacuum and HOT chain pruning would do that.