Pgadmin 4 database, tables and status code 500 - sql

? I tried to make a database using pgadmin4, i made it, then i'm trying to find the schema and tables to create the necessary tables but i get status code 500 from the database altogether ,is there any solution?

Related

Hive retrieving meta data too slow

Situation :
I am aiming to retrieve location info for a list of hive external tables. For one table the easiest way is just using show create table table_name but I have quite a number of table, so I am finding alternative to achieve this. I managed to find there is the sys db in hive.
It seems the db is storing meta info of all tables, and I found the table sds that is storing these location info.
However when I query this sds table with the simplest where query select * from sds where sd_id = a_sd_id searching for info of only one table. It takes more than 50 seconds to return the result.
On the other hand, what is weird is that if I try to retrieve the same info using show create table the_table_name command, all table info include the location info is returned in 0.05 second .
So now my questions is when I trigger show create table, where did hive retrieve these info? Is it the same source when I query from the sys.sds table? If the two are the same source then the huge time gap between the ways cannot be explained.
Could anyone help cast some light on why the situation turns out like this and how can I retrieve the location info as I expected, i.e. retrieving from mysql metastore which can return as fast as the show create table command? I suppose the show create table should be accessing the mysql. But if the sys db is a mapping of the mysql db, why the query on these tables return 100 times slower than the show create?

Access Macro Creating a Duplicate Table that then Breaks the Macro

I inherited an Access based dashboard which uses a series of SQL queries and Make Table actions to write the results of those queries into tables located in two other Access files.
There is a macro that runs all of the make table commands which in turn run the sql queries. All of them are working when I run this on my machine, but when I run it from our VM which handles scheduled refreshes, it creates a duplicate table for one of the queries.
If I delete that table from the Tables1 database, the Queries database will run successfully and create both the correct table, and the duplicate in Tables1. However, each subsequent time, the macro will fail with an error saying that the duplicate table already exists.
This is the make table sql:
SELECT [SQLQueryName].*
INTO [TableName]
IN 'filepath\Tables1.accdb'
FROM SQLQueryName;
This is the same structure that all the other make table queries are using and they are not having this issue. I'm not sure if this matters or will tell someone something, but the duplicate table is the same name with a 1 added to the end of it. We also recently had to get a new VM setup and there have been a lot of weird issues with things not working as they did in the previous VM where this had been running without issue for quite a long time.
So far I've tried compacting both the Query and Table1 Database files. I've tried deleting the make table query and making a new version. I've tried deleting the table and duplicate from Tables1. I've tried rolling back the database files to versions several weeks old. We also made sure that the version of Access is the same as on my PC.
I am currently attempting to change it to a delete row/append row method rather than a make table, but even if that works I would still love to know why this is happening.
Edit:
Actual Code from make table that is failing, removed filepath.
SELECT [012_HHtoERorOBS].*
INTO [HHtoER-Obs]
IN '\\filepath\MiscTablesB.accdb'
FROM 012_HHtoERorOBS;
Here is code from 2 other make table queries that are working. Each make table query follows an identical format of select * from the sql query to get the data into the table in the destination accdbs.
SELECT [010_ScheduledVisitsQuery].*
INTO ScheduledVisits
IN '\\filepath\MiscTablesB.accdb'
FROM 010_ScheduledVisitsQuery;
SELECT [020_HH_HO].*
INTO HH_Referred_to_HO
IN '\\filepath\MiscTablesB.accdb'
FROM 020_HH_HO;
All of these tables exist in the destination accdbs when the make table queries are run. The macro does not include any commands to delete tables. Here is a screenshot of the top of the macro, it repeats all the make table queries then ends with a command to quit access.

Oracle SQL parse whole script over Database Link instead of per Table#MY_DB_LINK

I have a complex sql script. All tables are on database(DB) 'A', when i run the script there i get the results after 50 minutes.
I have an ETL tool which runs the script on DB 'A' and fills a table on DB 'B' with the results.
The ETL tool is being fased out so for the future i need to execute the script from DB 'B' with a DB link to DB 'A' to still have the table with results on DB 'B'.
The DB link works fine. I have added #MY_DB_LINK to around 80 table references and 1 function call. However after 2 and a half hours of running the script this way i still have no results.
Is there a way to parse the whole script over the DB link to have the sql executed on DB 'A' and write the results to a table on DB 'B'? Can anyone think of a different solution?
Extra info which might clarify the situation:
DB 'A' is a weekly copy of a source system. The old copy is deleted and a new copy is created. I can not create anything on DB 'A', i only have read rights there. I can do anything i want on DB 'B'.
The Oracle Hint DRIVING_SITE may be able to help you with this.
Your milage may vary.

Get query of the table with all the records in it in SQL

HI I have a table in SQL. I want to create that table into another machine and get the DATA inside that table as well.
I don't wanna use the backup method because I have existing Stored Procedures in the other machine. I just want to get one table with all the records in it. ANy idea on how to do it?
Can you create a linked server on the target database and query the source database from the target?

How to get data from multiple databases in one query?

I'm using a Java driver for SQLite 3 and wanted to find out if there was any means to get data from multiple databases (db1.db, db2.db) in one query?
Does any driver for SQLite3 support this at the moment?
Say db1 has 100 rows and db2 has 100 rows, my requirement is to get 200 rows by querying these by a single query.
You'll probably want to look at the ATTACH DATABASE command:
http://www.sqlite.org/lang_attach.html
The ATTACH DATABASE statement adds another database file to the current database connection.
Here's a tutorial on how to use it:
http://longweekendmobile.com/2010/05/29/how-to-attach-multiple-sqlite-databases-together/