public inbox for [email protected]  
help / color / mirror / Atom feed
From: Sergey Shinderuk <[email protected]>
To: Tom Lane <[email protected]>
Cc: Антуан Виолин <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Error with DEFAULT VALUE in temp table
Date: Fri, 12 Sep 2025 15:43:09 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAFjUV9x3-hv0gihf+CtUc-1it0hh7Skp9iYFhMS7FJjtAeAptA@mail.gmail.com>
	<CAFjUV9ygrdpkcykvMis0pPwsJdJ+jZVB98mEgDb=w2qBpyXbjQ@mail.gmail.com>
	<[email protected]>
	<[email protected]>

On 12.09.2025 14:01, Sergey Shinderuk wrote:
> object_name is null for the table column, but not null for its default 
> value.
> 
> As for schema_name, I'm not sure whether it should be null or not. 
> Currently schema_name is null for triggers and policy objects, but that 
> may be accidental.


Perhaps "default value" should be like "table constraint", which have 
schema_name and null object_name.


     postgres=# create temp table bar (a int not null default 0);
     CREATE TABLE
     postgres=# alter table bar drop column a;
     ALTER TABLE
     postgres=# select * from dropped_objects \gx
     -[ RECORD 1 ]---+------------------------------
     n               | 1
     classid         | 1259
     objid           | 16445
     objsubid        | 1
     original        | t
     normal          | f
     is_temporary    | t
     object_type     | table column
     schema_name     | pg_temp
     object_name     |
     object_identity | pg_temp.bar.a
     address_names   | {pg_temp,bar,a}
     address_args    | {}
     -[ RECORD 2 ]---+------------------------------
     n               | 2
     classid         | 2604
     objid           | 16448
     objsubid        | 0
     original        | f
     normal          | f
     is_temporary    | t
     object_type     | default value
     schema_name     | pg_temp
     object_name     | bar
     object_identity | for pg_temp.bar.a
     address_names   | {pg_temp,bar,a}
     address_args    | {}
     -[ RECORD 3 ]---+------------------------------
     n               | 3
     classid         | 2606
     objid           | 16449
     objsubid        | 0
     original        | f
     normal          | f
     is_temporary    | t
     object_type     | table constraint
     schema_name     | pg_temp
     object_name     |
     object_identity | bar_a_not_null on pg_temp.bar
     address_names   | {pg_temp,bar,bar_a_not_null}
     address_args    | {}


Best regards,

-- 
Sergey Shinderuk		https://postgrespro.com/





view thread (9+ messages)  latest in thread

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: Error with DEFAULT VALUE in temp table
  In-Reply-To: <[email protected]>

* 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