Why is this error coming in datagrip IDE? - postgresql

I have downloaded pgAdmin, made a server, restored the database. Then I connected datagrip IDE with postresql. But then this error is coming
.

The search path set for the console is postgres.poublic (see top-right corner).
The table film seems to exist in schema dvdrental.public (see the database explorer on the left)

Potential explanations:
the table has a different name (for example "Film")
the schema of the table is not on your search_path
the table was created in a different database
the transaction that created the table never committed

Related

PostgreSQL with DataGrip - "table does not exist"

DataGrip is connected to a PostgreSQL database running on localhost.
DROP TABLE users returns 'table does not exist'
Dropping the table via the context menu -> drop works just fine, checked on another table (which had the same problems). In preview, exactly the same SQL I'm trying to run in the console is shown.
public.users yields the same results.
herokulocal.public.users yields "cross-database references are not implemented"
Other queries, such as select * from pg_catalog.pg_tables; work just fine.
Additionally, users is not visible in the results yielded by select * from pg_catalog.pg_tables;.
Given that the exact same query generated by WebStorm for context menu -> drop does not work in the console, it makes me think my console's running in some different context. Please note I'm a database layman.
What possibly could be wrong here?
I connected with a wrong database - postgres instead of herokulocal.

Can't see PostgreSQL public schema in Oracle SQL Developer

Using the answer from the Oracle SQL Developer and PostgreSQL question, I have connected Oracle SQL Developer (4.1.3.20) to my PostgreSQL (9.1.20) database.
But only a weird subset of the objects in the database appears in the SQL Developer "Connections" browser. Specifically:
The public schema (which is the default PG user data schema) doesn't show up. But if I create another schema (e.g. one named schema1 in the screen shots below), the schema does show up.
Within a visible schema (schema1), tables, views, their columns, and their data are visible. So are triggers. There are headings for indexes and functions, but the functions, trigger functions, and indexes that exist are not visible. There aren't even headings for sequences, domains, catalogs, and extensions. Refreshing the display of the schema evokes 'ERROR: syntax error at or near ""INDEX_NAME"" Position: 99'.
Here it is in screen shots:
This is the database as shown in the PgAdminIII object browser
This is the database as shown in the Oracle object browser - also showing the above-mentioned error message
Another weirdness: I can open a SQL window in the Oracle tool and execute both DML (select, insert, etc) and DDL (create table, create function, etc), even in the (invisible) public schema. I can even query the PG catalogs (information_schema and pg_catalog).
So the question is: How can I make the missing objects (most importantly, the public schema) visible in SQL Developer?
~ Thanks, Ken
With SQLdeveloper 4.2, public schema is back ;o)

Where to find my tables on DB2

I have created a table, but is not listed on DataStudio 4101(tables node)
I can insert data by sql commands and drop/create the table, but can not find it on the server Database Node, under tables.
Other tables are displayed, but not the new ones I made.
IF you are using DB2 for i, with "system naming" mode, then your tables may have been created in schema QGPL (the General Purpose Library) by default. Your DB2 session would find them by using its "library list", similar to a path list.

SQL Server Default Database when Query - master

I've been using SQL Server Management Studio (SSMS) for the last 8 years, and I keep on stumbling upon a problem. When I right click on a Table, and select SELECT TOP 2000 ROWS, the query editor opens up a new file with the query inside. This is nice and all for a quick review of the table.
The problem I have is the default database is changed from the actual database to the master database. I have sysadmin rights.
The query that gets generated by SSMS, then has the databse, schema, and table in brackets, i.e. [DB].[dbo].[TableName]
Is there a way to set the default database on the SELECT TOP 2000 ROWS command, to NOT go and set the default database to 'master' ?
The other workaround is to click on the table, and then do a 'New Query', which will keep the current database, and then I have to type in 'SELECT * FROM TableName'
In SSMS go to Security > Logins - choose your login, then right-click and choose Properties - at the bottom of the tab is an option called "Default Database" - this is what you want to change.

Transferring data from one database to another (Postgres)

I have 2 exactly same databases on 2 different machines(with different data that is), and I want to transfer contents of one table to the table from the other database, how do I do that from PgAdmin? I'm new to PostgreSQL Database, I'd do that easily with mysql phpmyadmin just export sql and I'd get text file with bunch of insert into statements, is there equivalent with PgAdmin ?
Yes, backup using "PLAIN" format (SQL statements) and then (when connected to the other DB) open the file and run it.
Or you could select "COMPRESS" format in the "backup" dialogue, and then you could use the restore dialogue.
Also there's an equivalent of phpMyAdmin for Postgres, called "phppgadmin". Select the table in question and then use the "Export" tab.
pg_dump from the command line