Cannot paste long query into psql

Open
#3,637 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
postgresql, rust
Domain
cli

Research direction

No source file or test is named. Start by reproducing the provided long SQL paste in a new Warp session with psql, then compare the input with the iTerm result. Done means long queries paste without mangling and can be submitted successfully in Warp.

Written by the indexing model from the issue text.

Description

bug needs-info ready-to-implement triaged
Discord username (optional)

No response

Describe the bug

I cannot paste any long query into psql when using Warp. Any long query got mangled into gibberish and doesn't work when I press enter at all. This is specific to Warp because I still can do it in iTerm

To reproduce

Simply start a new psql and paste this query into it with "CMD-V"

SELECT
  e.employee_id AS "Employee #"
  , e.first_name || ' ' || e.last_name AS "Name"
  , e.email AS "Email"
  , e.phone_number AS "Phone"
  , TO_CHAR(e.hire_date, 'MM/DD/YYYY') AS "Hire Date"
  , TO_CHAR(e.salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Salary"
  , e.commission_pct AS "Comission %"
  , 'works as ' || j.job_title || ' in ' || d.department_name || ' department (manager: '
    || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
  , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date, 'MM/DD/YYYY') || ' to ' || TO_CHAR(jh.end_date, 'MM/DD/YYYY') ||
    ' as ' || jj.job_title || ' in ' || dd.department_name || ' department' AS "History Job Title"
  
FROM employees e
-- to get title of current job_id
  JOIN jobs j 
    ON e.job_id = j.job_id
-- to get name of current manager_id
  LEFT JOIN employees m 
    ON e.manager_id = m.employee_id
-- to get name of current department_id
  LEFT JOIN departments d 
    ON d.department_id = e.department_id
-- to get name of manager of current department
-- (not equal to current manager and can be equal to the employee itself)
  LEFT JOIN employees dm 
    ON d.manager_id = dm.employee_id
-- to get name of location
  LEFT JOIN locations l
    ON d.location_id = l.location_id
  LEFT JOIN countries c
    ON l.country_id = c.country_id
  LEFT JOIN regions r
    ON c.region_id = r.region_id
-- to get job history of employee
  LEFT JOIN job_history jh
    ON e.employee_id = jh.employee_id
-- to get title of job history job_id
  LEFT JOIN jobs jj
    ON jj.job_id = jh.job_id
-- to get namee of department from job history
  LEFT JOIN departments dd
    ON dd.department_id = jh.department_id

ORDER BY e.employee_id;

Copied command output

psql -d hdev
psql (14.3, server 15.3 (Homebrew))
WARNING: psql major version 14, server major version 15.
         Some psql features might not work.
Type "help" for help.

hdev=# SELECT
hdev-#   e.employee_id AS "Employee #"
  , e.first_name || ' ' || e.last_name AS "Name"
  , e.email AS "Email"
  , e.phone_number AS "Phone"
  , TO_CHAR(e.hire_date, 'MM/DD/YYYY') AS "Hire Date"
  , TO_CHAR(e.salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Salary"
  , e.commission_pct AS "Comission %"
  , 'works as ' || j.job_title || ' in ' || d.department_name || ' department (manager: '
    || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
  , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' hdev-#   , e.first_name || ' ' || e.last_name AS "Name"
  , e.email AS "Email"
  , e.phone_number AS "Phone"
  , TO_CHAR(e.hire_date, 'MM/DD/YYYY') AS "Hire Date"
  , TO_CHAR(e.salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Salary"
  , e.commission_pct AS "Comission %"
  , 'works as ' || j.job_title || ' in ' || d.department_name || ' department (manager: '
    || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
  , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.starhdev-#   , e.email AS "Email"
hdev-#   , e.phone_number AS "Phone"
  , TO_CHAR(e.hire_date, 'MM/DD/YYYY') AS "Hire Date"
  , TO_CHAR(e.salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Salary"
  , e.commission_pct AS "Comission %"
  , 'works as ' || j.job_title || ' in ' || d.department_name || ' department (manager: '
    || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
  , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked   , e.phone_number AS "Phone"
  , TO_CHAR(e.hire_date, 'MM/DD/YYYY') AS "Hire Date"
  , TO_CHAR(e.salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Salary"
  , e.commission_pct AS "Comission %"
  , 'works as ' || j.job_title || ' in ' || d.department_name || ' department (manager: '
    || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
  , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' |hdev-#   , TO_CHAR(e.hire_date, 'MM/DD/YYYY') AS "Hire Date"
hdev-#   , TO_CHAR(e.salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Salary"
  , e.commission_pct AS "Comission %"
  , 'works as ' || j.job_title || ' in ' || d.department_name || ' department (manager: '
    || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
  , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date    , TO_CHAR(e.salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Salary"
  , e.commission_pct AS "Comission %"
  , 'works as ' || j.job_title || ' in ' || d.department_name || ' department (manager: '
    || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
  , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date  , 'work-- to get title of current job_id
  JOIN jobs j
    ON e.job_id = j.job_id
-- to get name of chdev-#   , e.commission_pct AS "Comission %"
  , 'works as ' || j.job_title || ' in ' || d.department_name || ' department (manager: '
    || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
  , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date  , 'work-- to get title of current job_id
  JOIN jobs j
    ON e.job_id = j.job_id
-- to get name of current mana-- to get name of current mahdev-#   , 'works as ' || j.job_title || ' in ' || d.department_name || ' department (manager: '
    || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
  , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date  , 'work-- to get title of current job_id
  JOIN jobs j
    ON e.job_id = j.job_id
-- to get name of current mana-- to get name of current mana-- to ON-- to get name of current mana-- to get name of current mana-- to ON-- to get namhdev-#     || dm.first_name || ' ' || dm.last_name || ') and immediate supervisor: ' || m.first_name || ' ' || m.last_name AS "Current Job"
hdev-#   , TO_CHAR(j.min_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') || ' - ' ||
hdev-#       TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date  , 'work-- to get title of current job_id
  JOIN jobs j
    ON e.job_id = j.job_id
-- to get name of current mana-- to get name of current mana-- to ON-- to get name of current mana-- to get name of current mana-- to ON-- to get name of cuments d
    ON d.department_id = e.department_id
-- to get name of manager of current department
-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (not equal to current      TO_CHAR(j.max_salary, 'L99G999D99', 'NLS_NUMERIC_CHARACTERS = ''.,'' NLS_CURRENCY = ''$''') AS "Current Salary"
  , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date  , 'work-- to get title of current job_id
  JOIN jobs j
    ON e.job_id = j.job_id
-- to get name of current mana-- to get name of current mana-- to ON-- to get name of current mana-- to get name of current mana-- to ON-- to get name of cuments d
    ON d.department_id = e.department_id
-- to get name of manager of current department
-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (not equal to current managerge-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager anhdev-#   , l.street_address || ', ' || l.postal_code || ', ' || l.city || ', ' || l.state_province || ', '
    || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date  , 'work-- to get title of current job_id
  JOIN jobs j
    ON e.job_id = j.job_id
-- to get name of current mana-- to get name of current mana-- to ON-- to get name of current mana-- to get name of current mana-- to ON-- to get name of cuments d
    ON d.department_id = e.department_id
-- to get name of manager of current department
-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (not equal to current managerge-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (unt-- (not equal to current manager and -- (not equal to current manager and -- (not equal to chdev-#     || c.country_name || ' (' || r.region_name || ')' AS "Location"
  , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date  , 'work-- to get title of current job_id
  JOIN jobs j
    ON e.job_id = j.job_id
-- to get name of current mana-- to get name of current mana-- to ON-- to get name of current mana-- to get name of current mana-- to ON-- to get name of cuments d
    ON d.department_id = e.department_id
-- to get name of manager of current department
-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (not equal to current managerge-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (unt-- (not equal to current manager and -- (not equal to current manager and -- (not equal to currey of-- (not equal to current manager and -- (not equal to currenthdev-#   , jh.job_id AS "History Job ID"
  , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date  , 'work-- to get title of current job_id
  JOIN jobs j
    ON e.job_id = j.job_id
-- to get name of current mana-- to get name of current mana-- to ON-- to get name of current mana-- to get name of current mana-- to ON-- to get name of cuments d
    ON d.department_id = e.department_id
-- to get name of manager of current department
-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (not equal to current managerge-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (unt-- (not equal to current manager and -- (not equal to current manager and -- (not equal to currey of-- (not equal to current manager and -- (not equal to current .emplo-- (not equal to current manhdev-#   , 'worked from ' || TO_CHAR(jh.start_date  , 'worked from ' || TO_CHARTO_  , 'worked from ' || TO_CHAR(jh.start_date  , |   , 'worked from ' n '   , 'worked from ' || TO_CHdep  , 'worked from ' || TO_CHAR(jh.start_date  , 'work-- to get title of current job_id
hdev(#   JOIN jobs j
hdev(#     ON e.job_id = j.job_id
hdev(# -- to get name of current mana-- to get name of current mana-- to ON-- to get name of current mana-- to get name of current mana-- to ON-- to get name of cuments d
hdev(#     ON d.department_id = e.department_id
hdev(# -- to get name of manager of current department
hdev(# -- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (not equal to current managerge-- (not equal to current manager and -- (not equal to current manager and -- (not equal to current manager and -- (unt-- (not equal to current manager and -- (not equal to current manager and -- (not equal to currey of-- (not equal to current manager and -- (not equal to current .emplo-- (not equal to current manageistory job_id
hdev(#   LEFT JOIN jobs jj
hdev(#     ON jj.job_id = jh.job_id
hdev(# -- to get namee of department from job history
hdev(#   LEFT JOIN departments dd
hdev(#     ON dd.department_id = jh.department_id
hdev(#
hdev(# ORDER BY e.employee_id;
Expected behavior

It should've worked like in iTerm
https://github.com/warpdotdev/Warp/assets/17341000/9a82aeb9-0783-400a-b793-e2771fbb0378

Screenshots

What it looks like now.
https://github.com/warpdotdev/Warp/assets/17341000/b8958b2d-334b-44f6-a535-2da3c7a74b1b

Operating system

MacOS

Operating system and version

Ventura 13.4.1

Shell Version

zsh 5.9 (x86_64-apple-darwin21.3.0)

Current Warp version

v0.2023.08.29.08.04.stable_00

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

Yes, this issue prevents me from using Warp daily.

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

Dominant language
Rust
Stars
65.1k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from warpdotdev/warp

All issues in warpdotdev/warp

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.