Jira (PDB-5103) To_string function adds trailing spaces

15 views
Skip to first unread message

Andrei Filipovici (Jira)

unread,
Apr 9, 2021, 12:36:02 PM4/9/21
to puppe...@googlegroups.com
Andrei Filipovici created an issue
 
PuppetDB / Task PDB-5103
To_string function adds trailing spaces
Issue Type: Task Task
Assignee: Unassigned
Created: 2021/04/09 9:35 AM
Labels: query-engine-improvements
Priority: Normal Normal
Reporter: Andrei Filipovici

When printing the month from a timestamp field using the to_string function, multiple spaces are added to the response. This happens for multiple format options, not just month.

Example:
For this query ["extract" [["function" "to_string" "producer_timestamp" "month"]]]
the result is: "to_string": "april "

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Andrei Filipovici (Jira)

unread,
Apr 9, 2021, 12:45:02 PM4/9/21
to puppe...@googlegroups.com
Andrei Filipovici updated an issue
 
PuppetDB / Bug PDB-5103
Change By: Andrei Filipovici
When printing the month from a timestamp field using the to_string function, multiple spaces are added to the response. This happens for multiple format options, not just month.

Example:
For this query ["extract" [["function" "to_string" "producer_timestamp" "month"]]]
the result is:  "to_string": "april    "


There is a disable unit test with this particular issue. It has to be enabled once this is fixed.

Andrei Filipovici (Jira)

unread,
Apr 9, 2021, 12:45:04 PM4/9/21
to puppe...@googlegroups.com

Andrei Filipovici (Jira)

unread,
Apr 19, 2021, 12:15:03 PM4/19/21
to puppe...@googlegroups.com

Andrei Filipovici (Jira)

unread,
Jun 7, 2021, 8:13:02 AM6/7/21
to puppe...@googlegroups.com
Andrei Filipovici updated an issue
When printing the month from a timestamp field using the to_string function, multiple spaces are added to the response. This happens for multiple format options, not just month.

Example:
For this query ["extract" [["function" "to_string" "producer_timestamp" "month"]]]
the result is:  "to_string": "april    "

There is a disable disabled unit test with this particular issue ticket id . It has to be enabled once this is fixed.

Andrei Filipovici (Jira)

unread,
Jun 7, 2021, 8:20:02 AM6/7/21
to puppe...@googlegroups.com
Andrei Filipovici updated an issue
When printing the month from a timestamp field using the to_string function, multiple spaces are added to the response. This happens for multiple format options, not just month.

Example:
For this query ["extract" [["function" "to_string" "producer_timestamp" "month"]]]
the result is:  "to_string": "april    "

* There is a disabled unit test with this ticket id. It has to be enabled once this is fixed. *

Bogdan Irimie (Jira)

unread,
Jun 16, 2021, 3:32:01 AM6/16/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Jun 16, 2021, 3:32:01 AM6/16/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-30.06.2021

Andrei Filipovici (Jira)

unread,
Jun 16, 2021, 7:44:02 AM6/16/21
to puppe...@googlegroups.com

Andrei Filipovici (Jira)

unread,
Jun 23, 2021, 6:12:02 AM6/23/21
to puppe...@googlegroups.com
Andrei Filipovici commented on Bug PDB-5103
 
Re: To_string function adds trailing spaces

There is no problem because this is how PostgreSQL renders the response with the month formatting mask. The result is blank-padded to 9 chars.
More info about the formatting mask can be found here: https://www.postgresql.org/docs/11/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIME-TABLE

Rob Browning (Jira)

unread,
Jul 12, 2021, 8:09:03 PM7/12/21
to puppe...@googlegroups.com
Rob Browning updated an issue
 
Change By: Rob Browning
Fix Version/s: PDB 6.18.0
Fix Version/s: PDB 7.5.0

Austin Blatt (Jira)

unread,
Jul 16, 2021, 2:31:03 PM7/16/21
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
Release Notes: Not Needed
Reply all
Reply to author
Forward
0 new messages