This question already has answers here:
pgAdmin III Why query results are shortened?
(2 answers)
Closed 6 years ago.
I have a dumb problem. Basically I just upgraded from pgsql 8.4 to 9.1 and upgrade to pgAdmin 1.20.
I have some tables that have large text fields and in the previous query tool I could query a row and copy-paste the data out of it to modify. In this case, I had a table that stored queries that I could run.
Once I upgraded to the new pgAdmin version, when I use the tool and query a row to pull out the text from a field in that row, it truncates the result and ends with an ellipsis (...).
I tried figuring out how to increase the mem on this so it doesn't truncate after 100 characters or so but couldn't.
Anybody have any ideas??
In pgAdmin options, you can change the length of the field. Do the following,
Go to:
File > Options > Query Tool > Max. characters per column
By default it is 256, you can increase it accordingly.
Hope this helps
Marlon Abeykoon's answer is good, but if you want a one-off output and don't want to change settings, then simply output to a file (two buttons along from the usual green 'go' arrow). This saves the entire output in a csv file.
Related
I am having difficulty with my decimal columns. I have defined a view in which I convert my decimal values like this
E.g.
SELECT CONVERT(decimal(8,2), [ps_index]) AS PriceSensitivityIndex
When I query my view, the numbers appear correctly on the results window e.g. 0,50, 0,35.
However, when I export my view to file using Tasks > Export Data ... feature of SSMS, the decimals lower than zero appear as ,5, ,35.
How can I get the same output as in the results window?
Change your query to this:
SELECT CAST( CONVERT(decimal(8,2), [ps_index]) AS VARCHAR( 20 ) ) AS PriceSensitivityIndex
Not sure why, but bcp is dropping leading zero. My guess is it's either because of the transition from SQL Storage to a text file. Similar to how the "empty string" and nulls are exchanged on BCP in or out. Or there is some deeper config (windows, sql server, ?) where a SQL Server config differs from an OS config? Not sure yet. But since you are going to text/character data anyway when you BCP to a text file, it's safe (and likely better in most cases) to first cast/convert your data to a character data type.
I've recently installed pgAdmin III 1.18.1 and noticed a strange thing:
Long json query results are shortened to 256 symbols and then ' (...)' is added.
Could someone help me disable this shortening?
Thanks to user Erwin Brandstetter for his answer on Database Administrators.
There is a setting for that in the options: Max characters per column - useful when dealing with big columns. Obviously your setting is 256 characters.
Set it higher or set it to -1 to disable the feature.
in pgadmin (Version 5.4) select
file >> preferences >> Query Tool >> Results grid
and change Resize by data? to false. This will the column be sized to the widest of the datatype or column name.
You know in SQL Developer, let's say a query returned 100 rows. Of those 100 rows you could ctrl shift and highlight just a portion of them then right click on that highlighted section and click count to get a total of the highlighted section. Any way to do that in MySQL Workbench?
On a side note, I can't believe they don't allow line numbering in the results section. It'd be a HUGE help.
Is there no way you could get your query to give you the rows that you are selecting. If you can do it manually I'm pretty sure you can run a query to return the results.
Is there any reason you have to use MySQL Workbench ?
for example HeidiSQL counts the rows you are selecting
When I first installed Mysql, mysql workbench was installed with it but I wasn't convinced, so I installed HeidiSQL and I'm fully satisfied.
This question already has answers here:
incomplete information from query on pg_views [duplicate]
(2 answers)
Closed 7 years ago.
I want to get the source code of a function in my db.
I run this query:
select proname,prosrc from pg_proc where...
However when I copy the data in the procsrc field it copy only some of the function code, the whole code is not shown. I suspect that somewhere in the preference there is a text size limit.
How do I fix it?
Character Types
Text type has unlimited length. There are another problem.
Or try to change Max characters per column option.
File > Options > Query Tool > Max. characters per column
Max characters per column - Use the Max characters per column field to
specify the maximum length of data displayed in a single column.
I've recently installed pgAdmin III 1.18.1 and noticed a strange thing:
Long json query results are shortened to 256 symbols and then ' (...)' is added.
Could someone help me disable this shortening?
Thanks to user Erwin Brandstetter for his answer on Database Administrators.
There is a setting for that in the options: Max characters per column - useful when dealing with big columns. Obviously your setting is 256 characters.
Set it higher or set it to -1 to disable the feature.
in pgadmin (Version 5.4) select
file >> preferences >> Query Tool >> Results grid
and change Resize by data? to false. This will the column be sized to the widest of the datatype or column name.