public inbox for [email protected]  
help / color / mirror / Atom feed
From: Igor Korot <[email protected]>
To: David G. Johnston <[email protected]>
To: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: How to get the data from the query
Date: Sun, 27 Apr 2025 01:02:12 -0500
Message-ID: <CA+FnnTx7FeO9wVPjNBnRmbBZPsTexAx1DMtB1C7rct65MQikNQ@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwa+vG9uA2cwF9csnXkUqeoCBxCV0Huz=_MOyRuVXyk+aw@mail.gmail.com>
References: <CA+FnnTxPsPRzOtLGh7389gwjS3tOJaLpQ3Jhxi26UOr9BW5a+g@mail.gmail.com>
	<CAKFQuwa+vG9uA2cwF9csnXkUqeoCBxCV0Huz=_MOyRuVXyk+aw@mail.gmail.com>

Running this query:

draft=# SELECT DISTINCT column_name, data_type,
character_maximum_length, character_octet_length, numeric_precision,
numeric_precision_radix, numeric_scale, is_nullabl
e, column_default, ordinal_position, CASE WHEN column_name IN (SELECT
ccu.column_name FROM information_schema.constraint_column_usage ccu,
information_schema.table_con
straints tc WHERE ccu.constraint_name = tc.constraint_name AND
tc.constraint_type = 'PRIMARY KEY' AND ccu.table_name = 'leagues' )
THEN 'YES' ELSE 'NO' END AS is_pk  F
ROM information_schema.columns WHERE table_name='leagues' ORDER BY
ordinal_position;



still produces good results:

column_name  |     data_type     | character_maximum_length |
character_octet_length | numeric_precision | numeric_precision_radix |
numeric_scale | is_nullable | col
umn_default | ordinal_position | is_pk
--------------+-------------------+--------------------------+------------------------+-------------------+-------------------------+---------------+-------------+----
------------+------------------+-------
id           | integer           |                          |
              |                32 |                       2 |
   0 | NO          |
           |                1 | YES
name         | character varying |                      100 |
          400 |                   |                         |
     | YES         |
           |                2 | NO
drafttype    | integer           |                          |
              |                32 |                       2 |
   0 | YES         |
           |                3 | NO
scoringtype  | integer           |                          |
              |                32 |                       2 |
   0 | YES         |
           |                4 | NO
roundvalues  | integer           |                          |
              |                32 |                       2 |
   0 | YES         |
           |                5 | NO
leaguetype   | character         |                        5 |
           20 |                   |                         |
     | YES         |
           |                6 | NO
salary       | integer           |                          |
              |                32 |                       2 |
   0 | YES         |
           |                7 | NO
benchplayers | integer           |                          |
              |                32 |                       2 |
   0 | YES         |
           |                8 | NO
(8 rows)

lines 1-12/12 (END)


Thank you.

On Sat, Apr 26, 2025 at 8:06 PM David G. Johnston
<[email protected]> wrote:
>
> On Saturday, April 26, 2025, Igor Korot <[email protected]> wrote:
>>
>> but the size comes out "" (empty)
>>
>
> What is the value you are expecting?  What is the minimal table definition (i.e., a one or few column table) that would produce this expected value?  What does psql show if you use it to output the query against that table?
>
> David J.
>






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: How to get the data from the query
  In-Reply-To: <CA+FnnTx7FeO9wVPjNBnRmbBZPsTexAx1DMtB1C7rct65MQikNQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox