This looks a bit like this case here:
PGAdmin: Not connected to the server or the connection to the server has been closed
Output of columns of type json seems not to work.
SELECT normal_column FROM table
Runs fine
SELECT * FROM table (or SELECT json_column FROM table)
Outputs: "Not connected to the server or the connection to the server has been closed."
But the notification window flashes the correct "Successfully run. N rows affected".
Did not have this problem with pgadmin 4.2 or 4.1.
This issue has been fixed
please try to test with nightly build tomorrow Ref: https://git.postgresql.org/gitweb/?p=pgadmin4.git;a=commitdiff;h=fbc6aea497c81b314e5744a24c643f369538a53d
Download: https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/
Related
I want to update some JSON data in SQLite database (.db file) and I met a problem.
I work in Microsoft SQL Server Management Studio where I added SQLite/SQL Server Compact Toolbox through Visual Studio Extensions. I'm succesfully able to connect to this file and I'm also able to run a query on this database (create table, insert data etc.). The only problem is that a table I want to update has a JSON column and I need to use the JSON_VALUE function to get some data from that column. And when I run SELECT JSON_VALUE([data]) FROM myTable, I get an error message:
ErrorCode : 1
Message : SQL logic error
no such function: json_value
Result : Error
for a query SELECT sqlite_version I got a result 3.24.0.
What am I doing wrong? What should I add to system to make this thing working? In standard SQL everything is working fine. SSMS is version 14.0.
I also tried programs "DB Browser for SQLite" and "SQLiteStudio" and also did the same example in Visual Studio and got exactly the same error.
Any hints (please step by step, I'm totally new to SQLite) would be appreciated.
i got this problem with postgreSQL, when i do a simple query of anything (CRUD), sometimes it works and almost always shows this message:
Not connected to the server or the connection to the server has been closed.
I don't know how to solve it and it started to irritate me, anyone know how to fix it?
UPDATE 1
I have been searching and it seems the pgadmin4 the problem (it seems because it's not 100% developed yet), i have been using pgadmin3 and that error doesn't show up.
solution is:
select the database where you lost the connection.
then on the right hand side select SQL
For example in the picture (shopdb) is the db where I lost the connection to.
After that PgAdmin will ask you if you would like to reconnect to this database...
click ok
you will notice a message retreiving data from the server
The reason this happened for me was a syntax error in the query. Check your syntax and try again, maybe this suffices
This issue has been fixed.
Upgrade to pgAdmin4 version 2.0. https://www.pgadmin.org/download/
I have similiar problem before, im using postgre 9.6.1-1
I can do select without condition (ex: select * from foodtable) and i can do insert too.. But if i do select or edit or delete using a condition (ex: select * from foodtable where taste='sweet') the output is like your
Not connected to the server or the connection to the server has been closed.
I try reinstall (After uninstall delete all leftover data) and delete C:\Users\yourUserName\AppData\Roaming\pgAdmin (delete all data inside pgAdmin Folder)
And its works
Update-> Your table name and field name must lowercase
Can you run & provide output of these sql queries from pgAdmin4?
1) SHOW SERVER_ENCODING;
2) SHOW CLIENT_ENCODING;
And what is the encoding set for your current database connection on which you are trying to run query (Right click on your database, click on Properties > Definition Tab > Check Encoding, Collation & Character type) ?
I'm suspecting you are facing issues due to encoding.
Change the versión of pgAdmin, use pgAdmin 3, its a problem frequently between Windows 10 and pgAdmin4.
just change the column name and run the query , it worked for me.
my column name was timestamp, it conflicted with datatype so i changed timestamp by _timestamp
Juuuuust in case someone googled this post like i did.
If you have JSON column AND you want to see ANY result in pgAdmin, cast JSON into VARCHAR like
SELECT id, metadata::VARCHAR FROM data_table;
It doesn't matter if content is NULL or not, JSON doesn't work. Maybe there are other types or values that can't be parsed by pgAdmin as well.
Note: you can still insert values and recieve them after cast, so the problem is on JS side (put one more coin into your "Hate JS" jar).
We have just experienced this on a standalone windows machine.
After reinstalling things and looking everywhere (logs, running psql in shell - all was good) then we found out that it was an older firefox that was the culprit.
So - please ensure that your browser is up to date :-)
I solved this. I pressed F7 or Explain in drop-down list near the Execute button. Then I saw where exactly the trouble was. pgAdmin4 didn`t like the name of my column. Then I went to problem column and renamed it.
I have same problem
but i can create DB and table successful
and my version is:
window10 pro x64
9.5 (X86)
pgAdmin4
after i change to 9.4 (X86)+ pgAdmin3 is no more error.. and the table i create by 9.5 can be use(insert data) in pgAdmin3
I am using the pgadmin version 4.6 which is the current release as for now.
I could only solve the problem by running query inside
DO $$ ... BEGIN ... END $$;
block.
In case anyone still looking for an answer like me.
I was getting this error when running a long series of queries in a transaction. Then when I ran them separately, it didn't loose the connection. Still no idea why it actually happens...
My operating system is windows 10.
pgAdmin Version - 4.5
I was getting this error when executing scripts, downgrading to pgAdmin version 4.3 fixed the issue for me.
I use symmetricds 3.8.0 to sync data between Oracle 12.1 and Mysql 5.5. Oracle is the Master Server. I use the demo properties to configure with modifying its db connection information.But when I execute command : bin/sym, there show the message below:
This node is configured as a registration server, but it is missing its node_identity. It probably needs configured
It only occur when the master server is Oracle, nothing with Mysql and Mssql, I try it many times but it still show this issue, Do someone meet this problem and help me?
sym_node_identity table has to be populated with one row describing the identity of the root DB on oracle
I am using : QT 5.0.2 + MinGW 4.7 + 32 bits + ODBC driver + Windows 7 (32) + SQL Server 2012 Express
The “problem”:
1) I’ve got one window showing records from a database table.
2) If somewhere in the application, I have to update the database without using ‘transactions’ everything works ok.
3) If somewhere in the application, I have to update the database using ‘transactions’ the records showing in the window (1) (*) disappeared and become blank records.
NOTE (*): If I’ve got more windows (MDI) showing several tables, all windows, all tables records go BLANK simultaneously.
I decided to check with “SQL Server Profiler” what happens on Server side when someone uses QSqlTableModel\QSqlQueryModel and I think I have “found” the (my) problem on Server but I am not sure where exactly is the problem on my / QT side:
1) when the window opens, QSqlTableModel\QSqlQueryModel (I think) creates a cursor “exec sp_cursoropen 180150003” on server
2) retrieves some records “exec sp_cursorfetch 180150003”
3) if the window repaint/refresh retrieves again some records “exec sp_cursorfetch 180150003”
4) after executing the “transaction” someone (who?) closes the cursor being used (I think) by QSqlTableModel\QSqlQueryModel “exec sp_cursorclose 180150003”
5) after that, there are no more entries of “exec sp_cursorfetch….” That’s why (I think) the QTableView show BLANK records.
NOTE (*): When using MDI subwindows showing each one of them a completely different and unrelated table. After the “transaction” all subwindows/QTableView automatically show BLANK records. I’ve checked with “SQL Server Profiler” and after the “transaction” there are as many “exec sp_cursorfetch” as opened subwindows.
It seems that all “cursors” are automatically closed, no matter if they are related with the updates (single table) being made.
Assuming that the “problem” is that\those “exec sp_cursorclose”, does anyone have an idea why that\those (exec sp_cursorclose) automatically happens:
Is it a ODBC (generally speaking) limitation?
Is it a ODBC (QT implementation) limitation?
Is it a ODBC (MSSQL implementation) limitation?
Is it a QSqlxxxxxx implementation/limitation?
What am I missing here?
Any suggestions or comments would be greatly appreciated
Are your sql insert's values and variables you want to enter into the server correct?
I know that this has nothing to do with what you are asking but small errors in mysql servers can cause others to occur. Wish you luck :)
I have created a linked-server definition according to the article at :
http://www.ideaexcursion.com/2009/01/05/connecting-to-oracle-from-sql-server/
My aim is to transfer rows to tables at Oracle 11gR2.
After creating linked server, whenever I try to select a table using a query like :
SELECT *
FROM [192.168.1.188]..[ESIPARIS].[T_ERROR_LOG]
I get the error below :
Msg 7356, Level 16, State 1, Line 1
The OLE DB provider "OraOLEDB.Oracle" for linked server "192.168.1.188"
supplied inconsistent metadata for a column. The column "EVENT_OBJECT"
(compile-time ordinal 2) of object ""ESIPARIS"."T_ERROR_LOG"" was reported
to have a "LENGTH" of 50 at compile time and 100 at run time.
One more thing is that it duplicates field names whenever a select statment is prepared by "Sql Server Management Studio", some fields are duplicated as below :
SELECT [EVENT_DATE]
,[EVENT_DATE]
,[EVENT_DATE]
,[EVENT_DATE]
,[EVENT_OBJECT]
,[EVENT_OBJECT]
,[EVENT_OBJECT]
,[EVENT_OBJECT]
,[MESSAGE]
,[MESSAGE]
,[MESSAGE]
,[MESSAGE]
,[EVENT_ID]
FROM [192.168.1.188]..[ESIPARIS].[T_ERROR_LOG]
I would be very happy to hear from you about any ideas, thank you for your concern,
Best Regards,
Kayhan YÜKSEL
There are a number of scenarios which might throw this error:
your distributed query in SQL Server references a view with an underlying table in Oracle with a primary key column created in a certain way, Find out more
there's a bug when the querying a view with numeric columns. Find out more
it may be a problem with driver incompatibility, such as using the MS OleDB driver instead of the one Oracle provides.
If it isn't the driver one possible workaround is to use OPENQUERY. Otherwise. this support note contains general information on troubleshooting linked server and Oracle.
(This problem is a fairly generic one, so it turned out that the actual resolution was none of the things I suggested. I'm incorporating #kayhanyüksel's solution in the body of this response for the sake of completeness.)
Solved it with changes at listener and tnsnames. We are now able to connect from SQL Server to Oracle 11gR2 (running on 64 bit Red Hat Enterprise Linux 5.4 ) and vice versa. Documents followed are
- Making a Connection from Oracle to SQL Server
- The Oracle Gateways documentation
I had the same problem: The column ...... was reported
to have a "LENGTH" of 50 at compile time and 100 at run time. and duplicate column names when selected.
while i was trying to run a query in MS SQL from an ORACLE 11g database
I used the follownig type of query and it worked !
DECLARE #TSQL varchar(8000)
SELECT #TSQL = 'SELECT * FROM OPENQUERY(MyLinkedServer,''SELECT * FROM TableName'')'
EXEC (#TSQL)
where MyLinkedServer is the name of the linked server and
TableName is the name of the table.
here you have the link to the article that helped me: http://support.microsoft.com/kb/314520
Old thread but it may be useful to someone.
When I recently encountered this error, using as provider the MS OleDB driver instead of the Oracle OleDB provider solved the problem.
I have the same issue with 11g client but it was disappeared with client version 12 which works for me is using OPENQUERY and to_char with the field that makes problem.
I confirm that SQL management studio (no matter what version) gives many duplicated field. The only installing of last driver version we can have consistent queries. I hope it can be useful for you!