pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Avoid orphaned objects dependencies, take 3
Date: Sun, 19 May 2024 11:00:00 +0300
Message-ID: <91643cfa-16f4-1bc2-e235-0dfa6d285b3a@gmail.com> (raw)
In-Reply-To: <ZkRy73Q2NDBT0Avq@ip-10-97-1-34.eu-west-3.compute.internal>
References: <ZidAHRJyMzPZ5JtJ@ip-10-97-1-34.eu-west-3.compute.internal>
	<Ziff3vGRKv1LUjY7@ip-10-97-1-34.eu-west-3.compute.internal>
	<ZijE6UBCo02U2TXJ@ip-10-97-1-34.eu-west-3.compute.internal>
	<62310067-6dc4-97ab-6724-7d3602b5056d@gmail.com>
	<ZinjZmaMEEkOSfZ0@ip-10-97-1-34.eu-west-3.compute.internal>
	<403075e1-4d60-09e2-a06a-749cd9d88f66@gmail.com>
	<ZioEJafHC95wjfMk@ip-10-97-1-34.eu-west-3.compute.internal>
	<d815344e-a6a2-617a-d35f-012e5e89f29f@gmail.com>
	<Zjy/o3t/26exwj5Z@ip-10-97-1-34.eu-west-3.compute.internal>
	<ZkQMYVxbOxFD0519@paquier.xyz>
	<ZkRy73Q2NDBT0Avq@ip-10-97-1-34.eu-west-3.compute.internal>

Hello Bertrand,

15.05.2024 11:31, Bertrand Drouvot wrote:
> On Wed, May 15, 2024 at 10:14:09AM +0900, Michael Paquier wrote:
>
>> +            if (object_description)
>> +                ereport(ERROR, errmsg("%s does not exist", object_description));
>> +            else
>> +                ereport(ERROR, errmsg("a dependent object does not ex
>>
>> This generates an internal error code.  Is that intended?
> Yes, it's like when say you want to create an object in a schema that does not
> exist (see get_namespace_oid()).

AFAICS, get_namespace_oid() throws not ERRCODE_INTERNAL_ERROR,
but ERRCODE_UNDEFINED_SCHEMA:

# SELECT regtype('unknown_schema.type');
ERROR:  schema "unknown_schema" does not exist
LINE 1: SELECT regtype('unknown_schema.type');
                        ^
# \echo :LAST_ERROR_SQLSTATE
3F000

Probably, it's worth to avoid ERRCODE_INTERNAL_ERROR here in light of [1]
and [2], as these errors are not that abnormal (not Assert-like).

[1] https://www.postgresql.org/message-id/Zic_GNgos5sMxKoa%40paquier.xyz
[2] https://commitfest.postgresql.org/48/4735/

Best regards,
Alexander





view thread (93+ messages)  latest in thread

Message-ID: <91643cfa-16f4-1bc2-e235-0dfa6d285b3a@gmail.com>
Permalink:  ../91643cfa-16f4-1bc2-e235-0dfa6d285b3a@gmail.com/
Also on:    postgresql.org/message-id/91643cfa-16f4-1bc2-e235-0dfa6d285b3a@gmail.com

 · 

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: pgsql-hackers@postgresql.org
  Cc: exclusion@gmail.com, bertranddrouvot.pg@gmail.com, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
  Subject: Re: Avoid orphaned objects dependencies, take 3
  In-Reply-To: <91643cfa-16f4-1bc2-e235-0dfa6d285b3a@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox