Long strings are being clipped with (...) in postgres [duplicate] - postgresql

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.

Related

Decimals less than 1 appear as ",x" in output file while they appear correctly in the result window

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.

Getting NULL Value in Stored Procedure TEXT Column

Below Query, I am using to get the SP definition but in TEXT column I am getting as NULL Value in IBM DATA Studio but I am able to CALL the SP.
SELECT PROCNAME, TEXT FROM SYSCAT.PROCEDURES WHERE PROCNAME LIKE '%USP_ABC%'
Please Help
You have confirmed that the syscat.procedures.language is SQL, and that your query-tool is able to display a substr() of the text.
Workaround depends on the length(text) of the row of interest:
SELECT PROCNAME, substr(TEXT,1, 1024) FROM SYSCAT.PROCEDURES WHERE PROCNAME LIKE '%USP_ABC%'
You may need to adjust the length of the substr extract depending on the length of the text and your configuration. For example substr(TEXT, 1, 2048 ) or a higher value for the length as necessary that your query-tool can cope with.
You can find the length of the text column with the LENGTH(TEXT) for the row of interest.
You can also CAST a CLOB to char or varchar to a length that fits within their limits and whatever query tool limitations you have.
Another option is to use a different query tool that can work with CLOB.
Are you using the latest version of Data Studio with the latest fix? It sounds like you might have an invalid UTF-8 character in you SP, or as you are using SUBSTR and SUBSTRING you are breaking a mulit-byte character in two.
You could try setting
-Ddb2.jcc.charsetDecoderEncoder=3
in your eclipse.ini to get Java to use a replacment character rather than replace the invalid string with nul
See this tech note
https://www-01.ibm.com/support/docview.wss?uid=swg21684365
Otherwise, do raise this with IBM Suppport

How to increase display length in pg admin tool [duplicate]

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.

Is it possible to extend Firebird table name length?

I'm a Firebird newbie here. I'm trying to use Firebird Embedded from an ASP.Net application. Everything connects fine but I'm running into problems with the length of column names. I'm trying to create a table named "Orchard_Framework_DataMigrationRecord." I keep getting an exception which says "Name longer than database column size." After some investigation, I've seen that a number of people have mentioned that Firebird has a column name length limit of 30 characters.
Is that correct and if so is there any way to change it? In my case, I can't change the name of the table; it really has to be that long.
Unfortunately there is no way to change the maximum identifier length, it's an implementation limit. There is a plan to remove this limitation but in current version (2.5) the max identifier length is 31 characters.
This appears to be fixed as of Firebird version 4.0 Alpha 1: Increase maximum length of object names to 63 characters

pgAdmin III Why query results are shortened?

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.