473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Spacing in output

I have a small training database: sql_tutorial. It works fine but the spacing
between the output lines is too much. This is the way it looks when I copy
and paste from the Konsole to this email:

sql_tutorial=> SELECT prod_name FROM Products;
prod_name
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8 inch teddy bear
12 inch teddy bear
18 inch teddy bear
This is the way it looks on the Konsole:

sql_tutorial=> SELECT prod_name FROM Products;

prod_name
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
------------------
8 inch teddy bear
12 inch teddy bear
18 inch teddy bear

How can I change the Konsole output to look like the first example?
Thanks,
Jerome

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
6 1333
The spacing in Konsole is directly related to the wrapping that it's
doing based on the size of the prod_name field (I.e., length in terms
of characters).

You can alter the format settings of psql. See:

http://www.postgresql.org/docs/7.4/static/app-psql.html

-tfo

On Sep 14, 2004, at 4:05 PM, Jerome Lyles wrote:
I have a small training database: sql_tutorial. It works fine but the
spacing
between the output lines is too much. This is the way it looks when I
copy
and paste from the Konsole to this email:

sql_tutorial=> SELECT prod_name FROM Products;
prod_name
-----------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
--------------------------------------------
8 inch teddy bear
12 inch teddy bear
18 inch teddy bear
This is the way it looks on the Konsole:

sql_tutorial=> SELECT prod_name FROM Products;

prod_name
-----------------------------------------------------------------------
---------------
-----------------------------------------------------------------------
---------------
-----------------------------------------------------------------------
---------------
------------------
8 inch teddy bear
12 inch teddy bear
18 inch teddy bear

How can I change the Konsole output to look like the first example?
Thanks,
Jerome

---------------------------(end of
broadcast)---------------------------
TIP 8: explain analyze is your friend

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
On Tue, Sep 14, 2004 at 11:05:46AM -1000, Jerome Lyles wrote:
I have a small training database: sql_tutorial. It works fine but the spacing
between the output lines is too much. This is the way it looks when I copy
and paste from the Konsole to this email:

sql_tutorial=> SELECT prod_name FROM Products;
Is prod_name a char(n) for some large n?

Cheers,
D prod_name
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8 inch teddy bear
12 inch teddy bear
18 inch teddy bear
This is the way it looks on the Konsole:

sql_tutorial=> SELECT prod_name FROM Products;

prod_name
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
------------------
8 inch teddy bear
12 inch teddy bear
18 inch teddy bear

How can I change the Konsole output to look like the first example?
Thanks,
Jerome

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


--
David Fetter da***@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3
On Tuesday 14 September 2004 11:27 am, David Fetter wrote:
On Tue, Sep 14, 2004 at 11:05:46AM -1000, Jerome Lyles wrote:
I have a small training database: sql_tutorial. It works fine but the
spacing between the output lines is too much. This is the way it looks
when I copy and paste from the Konsole to this email:

sql_tutorial=> SELECT prod_name FROM Products;


Is prod_name a char(n) for some large n?

Cheers,
D

char(255)
Jerome

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #4
On Tue, Sep 14, 2004 at 06:37:40PM -1000, Jerome Lyles wrote:
On Tuesday 14 September 2004 11:27 am, David Fetter wrote:
On Tue, Sep 14, 2004 at 11:05:46AM -1000, Jerome Lyles wrote:
I have a small training database: sql_tutorial. It works fine
but the spacing between the output lines is too much. This is
the way it looks when I copy and paste from the Konsole to this
email: sql_tutorial=> SELECT prod_name FROM Products;


Is prod_name a char(n) for some large n?

Cheers,
D

char(255)


Well, Don't Do That, Then. TEXT is a great type for storing text.
VARCHAR(n) is a TEXT with a maximum length constraint, and CHAR(n)
(fixed length) is pretty nearly obsolete.

Cheers,
D
--
David Fetter da***@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #5
On Wednesday 15 September 2004 05:24 am, David Fetter wrote:
On Tue, Sep 14, 2004 at 06:37:40PM -1000, Jerome Lyles wrote:
On Tuesday 14 September 2004 11:27 am, David Fetter wrote:
On Tue, Sep 14, 2004 at 11:05:46AM -1000, Jerome Lyles wrote:
> I have a small training database: sql_tutorial. It works fine
> but the spacing between the output lines is too much. This is
> the way it looks when I copy and paste from the Konsole to this
> email:
>
> sql_tutorial=> SELECT prod_name FROM Products;

Is prod_name a char(n) for some large n?

Cheers,
D


char(255)


Well, Don't Do That, Then. TEXT is a great type for storing text.
VARCHAR(n) is a TEXT with a maximum length constraint, and CHAR(n)
(fixed length) is pretty nearly obsolete.

Cheers,
D

This is amazing. Im using a book called 'Teach Yourself SQL in 10 minutes'
with a 2004 copyright and this is the second example of obsolete TEXT type
used in the examples so far.
Jerome

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #6
su******@hawaii.rr.com (Jerome Lyles) wrote in
news:200409141105.46091.su******@hawaii.rr.com:
I have a small training database: sql_tutorial. It works fine but the spacing between the output lines is too much. This is the way it looks when I copy and paste from the Konsole to this email:

the simplest is
SELECT prod_name::text FROM products;

(will cast the char(255) column to text and in the process removes all
trailing spaces.)

or use trim function to remove trailing spaces.

--
Rolf

Nov 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Rick DeBay | last post by:
I'm trying to create a layout table, where the spacing between rows varies. I've tried using setting margin-top and border-top for the rows I wan't spaced down from the one above, and I've also...
4
by: fleemo17 | last post by:
Is there a way to tweak the spacing of lines of text (or leading) *specifically* in IE6? I've created a "Quick Search" box in my layout which renders pretty consistently in all the browsers I've...
12
by: Sebastien B. | last post by:
I'm wondering if it's at all possible to have spacing between a table's cells, and only between the cells, not between the outter cells and the table's border. See end of message for an example...
4
by: metoikos | last post by:
I've scoured the web (clumsily, I'm sure) for information on the difficulties I am having, checked my markup in validators, and had a friend with more CSS clue look over it, but I haven't had any...
10
by: phil-news-nospam | last post by:
I have a table with 3 columns in 1 row. I want to increase the spacing _between_ the columns (gutter) _without_ increasing the spacing between those columns and the table itself. Is there a way...
3
by: WuJianWei | last post by:
If you type a string: "It's good." there's one space between the two words. but how can i adjust the string to two spaces or more. "it's good."
8
by: harishram007 | last post by:
Sorry for the inconvienience but i am expecting this pattern the pattern is in the attachment....i am just pasted my code and want alterations....please help but i am ending up wid something like ...
1
by: replyrpatil | last post by:
What I am trying to do: I need to print a compact access report (font 6 size) created using RTF2 program developed by Stephen Lebans to generate a TIF image of custom size (5.5 in x 2.0 in) ...
3
by: =?ISO-8859-1?B?QW5kcukgSORuc2Vs?= | last post by:
Hi, I'm experiencing very bad character spacing / anti-aliasing with a PHP installation. I compared it to another installation where it works. I'm using the following test code: $ih =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.