Select * from showing blank in PSQL shell after changing data type to binary - postgresql

I'm using Ecto/Elixir with Postgres and I created a field with the binary datatype. Everything is working OK except that now when I make a simple query: Select * from "table name"; the sql shell shows only blank and seems that didn't like it...
What should I do to see these contents?

By default, psql display contents in cells aligned inside a grid. Each column is made wide enough to accodomate the largest value in it, and the smaller contents get blank-padded. When a column is much wider than the size of its containing window, entire pages of contents appear to be blank because of all the padding inside giant column(s) and the wrapping across consecutive lines.
The simplest workaround against that is to turn off alignement, with
\pset format unaligned or the on/off shortcut \a
Sometimes it's also interesting to use horizontal scrolling. Personally I use less as a pager with LESS=-FX as options and occasionally run inside psql:
\setenv LESS -FXS
then when displaying a result larger than the window, it does not wrap horizontally and the left and right cursor keys allow to scroll horizontally.
Also even when not using -S and when horizontal wrapping occurs, it's still possible with less to switch to horizontal scrolling/paging by hitting the right cursor key → or ESC) :
ESC-) or RIGHTARROW
Scroll horizontally right N characters, default half the screen width (see the -#
option). If a number N is specified, it becomes the default for future RIGHTARROW
and LEFTARROW commands. While the text is scrolled, it acts as though the -S option
(chop lines) were in effect.

Related

Can I make VSCode column mode like Notepadd++?

I'm a longterm user of Notepad++ and new user of VSCode, where I think the column mode workflow is rather poor. I'm seeking help to reproduce the NPP workflow so far as is possible.
In NPP it goes like this:
hold down AltGR (right hand Alt key)
select column with mouse
copy to clipboard
choose destination top left anchor
paste
Pasting overwrites whatever was there before with the clipped column, which is clear and obvious.
The column always pastes exactly as selected. Whitespace is auto-created before the column if it's pasted into a blank area.
In VSCode I have to
select top or bottom corner of intended column
hold down left hand Alt plus shift
select column with mouse
copy to clipboard
use same technique to choose destination column
paste
I use a mouse in my left hand. The key combination requires a really awkward reach across the keyboard. Attempting to use AltGR as a keybinding shows it to be 'Alt' the same as the key on the left. But it doesn't work as Alt for binding column mode so I can't use the right hand pair.
Unless the destination column is accurately chosen pasting will overwrite with the clipped contents including introduced linebreaks but not respecting the column indentation. For instance clipping a 3 line column and pasting into a 2 line selection produces the most extraordinary mess. Counting lines manually is fine with just two or three but rapidly becomes absurd.
Pasting into a blank area isn't possible.
Pasting into whitespace is governed by indentation rules. I've turned them off, so pasting a column puts the first line in the right place and the rest at the margin. That isn't ever likely to be what's actually wanted.
To my mind the workflow is backwards: in my head it goes 'I want column mode, now I'll choose the column' not 'I'll choose some anchor and then invoke column mode'. Maybe that's just me.
So I'm finding it all very unnatural. Can anyone suggest which if any parts of this can be changed for the better please.
You can use middle-click-drag to do what you want, although it's pretty awful.

How to add automatically expanding horizontal space in libreoffice (similar to say flex justify-content space-around)

I'm trying to achieve this effect:
|First phrase...............................................Second phrase|
Where the | markers above denote the page margins, and ....... represents a 'horizontal space' (which may or may not use space as the character, a 'dot' as above, or any other character), which effectively expands to take as much space as possible between the two pieces of text.
This is pretty common, e.g., when designing a table of contents manually*, or when trying to achieve the kind of "chapter X...........page Y" effect in headers.
I know there's a specific and easy way to introduce this kind of 'expanding horizontal space', because I've done it in the past. But I just can't find it anymore. I just vaguely remember that the relevant menu allowed you to specify what character you wanted to use in this 'expanding space'. Also, it may or may not have involved the use of tabs.
Any ideas?
* Yes I know about the "Table of Contents" menu option, no I'm not trying to design a table of contents, it was just an example :)
I remembered.
Create a tab stop on the horizontal ruler above the page, right click to convert from a 'left' stop to a 'right' stop, and drag that stop all the way to the right margin.
Then, next time you press 'tab', the tab will automatically push any content to the right of your cursor, all the way to the right margin.
If you optionally also specify a fill character in the 'Tabs' tab of the 'Paragraph' formatting menu, the tab space will be filled with that character.

Print query results when using format=alinged, instead of open them in EDITOR

If a do a select and only retrieve a few columns, the results are printed to the terminal, if I have more columns, and they do not fit in the terminal width, the query results are opened in the default editor (vim), but when I exit the editor the results are no longer visible.
I know I can user \x (but I have many rows, and for my it's seems worst ).
If I change the format to unaligned, html, latex or troff-ms even if the results are wider then the terminal width they are still printed.
When the resulted rows do not fit in the terminal height they are always opened in the default EDITOR, no mater what format I am using.
Q:
There is any posibility to use format=aligned and allways print the results instead of opening them in the default EDITOR, so I will not loose their visibility (something similar to what mysql-client does) ?
Thank you.
The query results are passed to the PAGER program when they don't fit in the screen, unless it's disabled with \pset pager off. EDITOR is used for input.
Some pagers restore the previous display when they quit, and it can be quite irritating when you need to use previous results in further queries.
I've found PAGER="less -FX" to be a good fit with psql since it allows scrolling in both directions and keeps the display intact when it quits.

How to align lines in Crystal Reports

Is there a good way to make horizontal lines actually line up in Crystal Reports? I can select text and field objects, right-click, and do various sizing and alignments. But that's not an option with a line. I need header fields underlined (and for whatever reason, our standard says to NOT use underline), and I want them to line up across the report.
It's a pain, but I've found one way to do it.
Both field and line items have a right-click menu option called "Size and Position". It doesn't take just any value, especially with Snap to Grid turned on (and doesn't always take exactly what you choose with it not turned on), but you can carefully make sure each line has the same Y value (for horizonal lines). And, if you want them to align and be the same length as the field headers they are underlining, compare each header field X and Width values, and make each line also match that.
In design mode, you can add horizontal guide lines by clicking in the ruler (the vertical one) fields will get sticky to it.
You can also select several fields, right click "Align > Bottoms" and them move the fields to the guide lines.
You can also format a single field to "lock its position and size", then Align the others to it
Another way is to select all the lines you want to left align, move them to the far left with the left cursor key until they hit the left margin and keep pressing the left key until they all align themselves. Just a trick!
Put a bottom border on the header Text Object.

Hide row (and remove whitespace placeholder) of tablix in Reporting Services 2008

I have a row in a tablex that I want to hide based on a condition. I can do this with the visibility property and also using CanShrink as well is an option.
I've tried both of these and the best I can do is hide the row (make it invisible), but it keeps the whitespace it takes up - I need to remove the whitespace too so if it is not shown that it doesn't take up paper/viewing space.
I have also made the height of the row very small and put cangrow=true so that that if i populate the field with data based on an expression it will grow to the right size but this is not ideal because there is still 0.03125in of space for the row that is always shown (minimim height) and if it grows it grows to fit the text but not neccessarily the set size I want.
I thought I had done this before in an older version of RS but I can't seem to get it to work correctly in this version (2008).
Any ideas?
Try to set the Hidden property of the Static Row Group under the Details Group, in this case the whole row will disappear instead of the content of the textboxes.
If you are using Report Builder, you need to switch to Advanced Mode (make sure that the Properties and the Grouping windows are displayed, go to the upper right side of the Grouping window and press the black triangle):
Click on the second "Static" item under the "(Details)" group and you can set the Hidden property on the Properties window.
Link to MSDN sample
A simpler way to get to this option for hiding a row is to right-click on the row header and select "Row Visibility". From there you will get a dialog where to can enter an expression.
I was able to make the rows go away by setting the following 2 properties
textbox.CanShrink
row.Hidden
I played w/ row.HideIfNoRows and it seems to have no effect in accomplishing the desired outcome described by op.
Click on textbox, these one is in the properties of the textbox
(if there are multiple columns, I assume you will have to make this setting for each cell/textbox, in my case, I only had 1 column)
CanShrink=false
For the next property, you have to go into ADVANCED MODE by clicking the down arrow at the right side of the Row Groups/Column Groups pane.
Click on the Row containing the line you would like to hide.
The Hidden property can be found in properties pane...
This is an alternate way to set Hidden, as opposed to right clicking the Row Header in the actual Tablix.
Hidden= <expression describing when you want the row hidden hidden>
One other note - If you right click the Row Header and choose 'Row Visibility' you get a dialgue. the Row Property dialog has a caption "Show or Hide Based on an expression".
The actual behaviour is It will HIDE the row if the expression evaluates to TRUE.
IMHO - this is misleading, at best ambiguous.
Once you understand the property you are actually setting is called HIDDEN, then this makes sense. Until then, I certainly assumed I was setting a property called Visisble... FWIW....
On the empty row you want to hide, go to the text box properties and go to expressions -> visibility, then show or hide based on an expression and use
=iif(first(Fields!.Value = ""),true,false)
Setting row visibility logic is important, but I've learned that sometimes a blank row will still appear, even though its contents are hidden. To solve this, I had to do the following non-intuitive steps, but I did in fact succeed in completely suppressing unwanted white space.
In the cell in the tablix region, use the Insert > Rectangle menu option.
In the rectangle, use the Insert > Textbox menu option. Resize as needed.
In the textbox, right-click and enter a placeholder.
Set the value of the placeholder expression to whatever you need.