Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8000113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:41:49+00:00 2026-06-04T15:41:49+00:00

Very short question. Can anyone say why this query select LENGTH(‘ ‘::char || ‘

  • 0

Very short question. Can anyone say why this query

select LENGTH(' '::char || ' '::char), LENGTH(' '::text || ' '::char), LENGTH(' ' || ' '), LENGTH('a'::char || 'b'::char);

returns

0    1    2    2

Is space a special character witch don’t concatenate with other strings?

Documentation says only this:

Unless otherwise noted, all of the functions listed below work
on all of these types, but be wary of potential effects of
automatic space-padding when using the character type.

Why I do this? Because i’m building string char by char in stored procedure, and when i try to concatenate varchar with char nothing happens.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:41:51+00:00Added an answer on June 4, 2026 at 3:41 pm

    The CHAR type is “fixed-length, blank padded”. This means that if you store "foobar" into a char(10) field, Postgres actually stores "foobar " (that’s four trailing spaces, SO does not preserve adjacent whitespace). When you fetch back your value, any trailing whitespace is stripped out. The same happens with ' '::char — its trailing whitespace is stripped, leaving only a zero-length string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: For anyone coming to this question through searching, you can install a Gnome
I have a very short question: How can i fetch mysql content using php
This may be very simplistic question but I can't find the answer. I want
The short version of this question is: How can I take data that only
very short question. Is C++ typeof operator standard? de facto standard? which compilers do
First question here: it is a very short yet fundamental thing in Java that
I have a very short and straight to the point question. When adding an
So I had to create this splash page in a very short amount of
Sorry if this is a stupid noob question. I'm doing a very small project
I am very new to bash. So if this is a pretty basic question,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.