public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH 2/3] Allow composite types in bootstrap
3+ messages / 3 participants
[nested] [flat]

* [PATCH 2/3] Allow composite types in bootstrap
@ 2020-11-17 15:28 Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Justin Pryzby @ 2020-11-17 15:28 UTC (permalink / raw)

---
 src/backend/bootstrap/bootstrap.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index 18eb62ca47..e4fc75ab84 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -916,6 +916,7 @@ gettype(char *type)
 {
 	if (Typ != NIL)
 	{
+		static bool did_reread PG_USED_FOR_ASSERTS_ONLY = false; /* Already reread pg_types */
 		ListCell *lc;
 
 		foreach (lc, Typ)
@@ -927,6 +928,33 @@ gettype(char *type)
 				return app->am_oid;
 			}
 		}
+
+		/*
+		 * The type wasn't known; check again to handle composite
+		 * types, added since first populating the array.
+		 */
+
+		/*
+		 * Once all the types are populated and we handled composite
+		 * types, shouldn't need to do that again.
+		 */
+		Assert(!did_reread);
+		did_reread = true;
+
+		list_free_deep(Typ);
+		Typ = NULL;
+		populate_typ_array();
+
+		/* Need to avoid infinite recursion... */
+		foreach (lc, Typ)
+		{
+			struct typmap *app = lfirst(lc);
+			if (strncmp(NameStr(app->am_typ.typname), type, NAMEDATALEN) == 0)
+			{
+				Ap = app;
+				return app->am_oid;
+			}
+		}
 	}
 	else
 	{
-- 
2.26.2


--------------76B8D0DC8AE327D516738282
Content-Type: text/x-patch; charset=UTF-8;
 name="0003-Extended-statistics-on-expressions-20210108.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0003-Extended-statistics-on-expressions-20210108.patch"



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Add const qualifiers
@ 2023-09-26 10:34 Peter Eisentraut <[email protected]>
  2023-09-26 20:19 ` Re: Add const qualifiers David Steele <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Peter Eisentraut @ 2023-09-26 10:34 UTC (permalink / raw)
  To: David Steele <[email protected]>; pgsql-hackers

On 09.09.23 21:03, David Steele wrote:
> On 9/1/23 11:39, David Steele wrote:
>> Hackers,
>>
>> I noticed that there was a mismatch between the const qualifiers for 
>> excludeDirContents in src/backend/backup/backup/basebackup.c and 
>> src/bin/pg_rewind/file_map.c and that led me to use ^static 
>> const.*\*.*= to do a quick search for similar cases.
>>
>> I think at the least we should make excludeDirContents match, but the 
>> rest of the changes seem like a good idea as well.
> 
> Added to 2023-11 CF.

committed







^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Add const qualifiers
  2023-09-26 10:34 Re: Add const qualifiers Peter Eisentraut <[email protected]>
@ 2023-09-26 20:19 ` David Steele <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: David Steele @ 2023-09-26 20:19 UTC (permalink / raw)
  To: Peter Eisentraut <[email protected]>; pgsql-hackers

On 9/26/23 06:34, Peter Eisentraut wrote:
> On 09.09.23 21:03, David Steele wrote:
>> On 9/1/23 11:39, David Steele wrote:
>>> Hackers,
>>>
>>> I noticed that there was a mismatch between the const qualifiers for 
>>> excludeDirContents in src/backend/backup/backup/basebackup.c and 
>>> src/bin/pg_rewind/file_map.c and that led me to use ^static 
>>> const.*\*.*= to do a quick search for similar cases.
>>>
>>> I think at the least we should make excludeDirContents match, but the 
>>> rest of the changes seem like a good idea as well.
>>
>> Added to 2023-11 CF.
> 
> committed

Thank you, Peter!






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2023-09-26 20:19 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 15:28 [PATCH 2/3] Allow composite types in bootstrap Justin Pryzby <[email protected]>
2023-09-26 10:34 Re: Add const qualifiers Peter Eisentraut <[email protected]>
2023-09-26 20:19 ` Re: Add const qualifiers David Steele <[email protected]>

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