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


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



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

* Re: Postgres 14.2 Windows can't rename temporary statistics file
@ 2022-02-15 01:08  Ranier Vilela <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Ranier Vilela @ 2022-02-15 01:08 UTC (permalink / raw)
  To: Justin Pryzby <[email protected]>; +Cc: pgsql-hackers

Em seg., 14 de fev. de 2022 às 21:58, Justin Pryzby <[email protected]>
escreveu:

> On Mon, Feb 14, 2022 at 09:19:54PM -0300, Ranier Vilela wrote:
> > I've reported this issue, but without success in fixing it.
>
> It'd be helpful to provide a link to the prior discussions, and summarize
> it.
>
> https://wiki.postgresql.org/wiki/PostgreSQL_14_Open_Items
>
> https://www.postgresql.org/message-id/[email protected]...
>
> See also e2f0f8ed251d02c1eda79e1ca3cb3db2681e7a86
>
I can't be sure if this is a case of DELETE_PENDING,
but FlieMoveEx apparently solves it.

regards,
Ranier Vilela


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

* Re: Postgres 14.2 Windows can't rename temporary statistics file
@ 2022-02-15 01:57  Thomas Munro <[email protected]>
  parent: Ranier Vilela <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Thomas Munro @ 2022-02-15 01:57 UTC (permalink / raw)
  To: Ranier Vilela <[email protected]>; +Cc: Justin Pryzby <[email protected]>; pgsql-hackers

On Tue, Feb 15, 2022 at 2:09 PM Ranier Vilela <[email protected]> wrote:
> Em seg., 14 de fev. de 2022 às 21:58, Justin Pryzby <[email protected]> escreveu:
>> On Mon, Feb 14, 2022 at 09:19:54PM -0300, Ranier Vilela wrote:
>> > I've reported this issue, but without success in fixing it.
>>
>> It'd be helpful to provide a link to the prior discussions, and summarize it.
>>
>> https://wiki.postgresql.org/wiki/PostgreSQL_14_Open_Items
>> https://www.postgresql.org/message-id/[email protected]...
>>
>> See also e2f0f8ed251d02c1eda79e1ca3cb3db2681e7a86
>
> I can't be sure if this is a case of DELETE_PENDING,
> but FlieMoveEx apparently solves it.

Can you explain why it solves it?

Have you seen this?

https://commitfest.postgresql.org/37/3347/

Do you know if FileMoveEx might be magically doing POSIX-style
operations when NTFS is used, on some recent version of Windows, as
was described at [1][2] with respect to DeleteFileEx?  CF #3347 is
about explicitly asking for those semantics, but [1] says that the
need to do that might be going away.

One of the reasons I have been putting off committing #3347 (other
than my desire to remove the pre-Win10 support) is (1) the hypothesis
that the problem might become simpler to solve as of some Windows 10
version as you might be seeing with your FileMoveEx test and (2) I'm
not sure how to handle the fact that once all the build farm animals
and CI systems are using POSIX semantics on NTFS, we'll have no
testing of the non-POSIX/traditional Windows semantics.  I mean stuff
like e2f0f8ed.  I suppose we really should have a non-NTFS build farm
animal, and I think we should have something like pg_test_dirmod.exe
that runs through a bunch of  standalone tests.

[1] https://stackoverflow.com/questions/60424732/did-the-behaviour-of-deleted-files-open-with-fileshare-...
[2] https://www.postgresql.org/message-id/[email protected]






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


end of thread, other threads:[~2022-02-15 01:57 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]>
2022-02-15 01:08 Re: Postgres 14.2 Windows can't rename temporary statistics file Ranier Vilela <[email protected]>
2022-02-15 01:57 ` Re: Postgres 14.2 Windows can't rename temporary statistics file Thomas Munro <[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