SPI_CURSOR_FIND(3)

πŸ“¦ version 14.24, in opensuse-leap 16.0

✨ SPI_CURSOR_FIND πŸ’…

okay so bestie, you know how sometimes a function hands you back a cursor name as plain text and you're standing there like "...and what am I supposed to do with this string??" πŸ₯² That's literally this page. It's from the PostgreSQL 14.24 docs, section SPI_CURSOR_FIND(3), and it's short, sweet, and honestly kinda iconic.


🌸 SYNOPSIS

Portal SPI_cursor_find(const char * name)

one line, one function, zero drama. we love a concise king. πŸ‘‘


πŸ¦‹ DESCRIPTION

SPI_cursor_find finds an existing portal by name. That's it, that's the whole vibe. πŸŽ€

It's primarily useful when you need to resolve a cursor name that some other function returned to you as text β€” like, you've got a name, and now you want the actual portal it points to. very "match the name to the face" energy. iykyk. πŸ’–


πŸ“ ARGUMENTS

  • const char * name β€” the name of the portal. that's the whole argument list. no sneaky extras, no surprise defaults, just the name. 🫢

🌈 RETURN VALUE

A pointer to the portal with the specified name β€” or NULL if none was found. 😭

yes, NULL is a real possibility, so please, for the love of everything, check it. don't just rawdog that pointer into the void and hope. πŸ’€


πŸ‘‘ NOTES

okay listen, this is the important part, pay attention bestie πŸ’…

Beware that this function can return a Portal object that does not have cursor-like properties β€” for example it might not return tuples. πŸ™ˆ

if you simply pass that Portal pointer along to other SPI functions, they can defend themselves against such cases. but if you're going to go poking around and directly inspecting the Portal yourself? caution is appropriate, fr fr. you've been warned, don't come crying to me. 🧚 ✨


and that's the page, bestie β€” short and slay. this lil rewrite is based on the PostgreSQL 14.24 documentation for SPI_CURSOR_FIND(3), dated 2026. go forth and resolve your cursor names responsibly πŸ’–πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from