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 7634721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:15:07+00:00 2026-05-31T07:15:07+00:00

Consider WITH t (f0, f1) as ( values (1, 10), (2, 20) )… How

  • 0

Consider

WITH t (f0, f1) as (
  values 
     (1, 10),
     (2, 20)     
)...

How do I specify that f0 and f1 are of type bigint?

  • 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-05-31T07:15:08+00:00Added an answer on May 31, 2026 at 7:15 am

    I think you’d have to specify the types inside the VALUES expression in your case:

    WITH t (f0, f1) as (
      values 
         (1::bigint, 10::bigint),
         (2, 20)
    )...
    

    You only need the types on the first set of values, PostgreSQL can infer the rest.

    For example, suppose we have two functions:

    create function f(bigint, bigint) returns bigint as $$
    begin
        raise notice 'bigint';
        return $1 * $2;
    end;
    $$ language plpgsql;
    
    create function f(int, int) returns int as $$
    begin
        raise notice 'int';
        return $1 * $2;
    end;
    $$ language plpgsql;
    

    Then

    WITH t (f0, f1) as (
        values
            (1, 10),
            (2, 20)
    )
    select f(f0, f1) from t;
    

    will give you two int notices whereas

    WITH t (f0, f1) as (
        values
            (1::bigint, 10::bigint),
            (2, 20)
    )
    select f(f0, f1) from t;
    

    would give you two bigint notices.

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

Sidebar

Related Questions

Consider that I have a map of sets of values to values, in Java
Consider the scenario I have values assigned like these Amazon -1 Walmart -2 Target
Consider this Python code for printing a list of comma separated values for element
Consider the following code: List<double> l = new List<double>(); //add unknown number of values
Consider this example: l = [1, 2, 3, 4, 5] for values in l:
For Binary trees: There's no need to consider tree node values, I am only
Consider this javascript: var values = { name: Joe Smith, location: { city: Los
Let's consider this basic insert insert into TableName (Col1,Col2,Col3) values (Val1,Val2,Val3) i want this
I have a table Login(id(int),EmailId(varchar(35),connType(varchar)) where conntype has values like pop3 or imap. consider
Let's consider a vector of numeric values x. Some values may be duplicates. I

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.