PQinitTypes(3)

πŸ“¦ version 1.5.1, in debian bookworm, ubuntu jammy, ubuntu noble

✨ PQinitTypes(3) ✨

okay so bestie, welcome to the libpqtypes Manual πŸ’– this one's about PQinitTypes β€” the little function that gets libpqtypes talking to the libpq event system. it's giving "warm-up before the main character takes the stage" energy, and honestly? iconic. πŸŽ€


🌸 NAME 🌸

PQinitTypes β€” initializes libpqtypes with the libpq event system. periodt. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libpqtypes.h>

int PQinitTypes(PGconn *conn);
int PQclearTypes(PGconn *conn);

two functions, one header, zero drama. 🫢


πŸ’… DESCRIPTION πŸ’…

so here's the tea β˜• β€” libpqtypes makes use of the libpq Event System. that means before you do literally anything else with libpqtypes, you must initialize it as a libpq EventProc. no skipping, no shortcuts, no "i'll do it later" (you will not do it later, bestie, i know you 😭).

PQinitTypes takes a PGconn that libpqtypes will be initialized with. and here's the key part β€” each PGconn requires its own initialization. like, every single one. they don't share. no cap. πŸ”₯

PQclearTypes removes all registered types from the given PGconn. a good use for this is after a PQresetXXX call, when it might be desired to re-register all types that may have gone stale. so like, the connection got reset and now your type registrations are lowkey expired β€” clear 'em and re-register, and you're back to slaying. πŸ‘‘


⭐ RETURN VALUE ⭐

PQinitTypes and PQclearTypes return zero if it fails and non-zero if it succeeds. yes bestie, you read that right β€” 0 is the fail case, not the win case. it's giving chaotic but that's just how it is. don't get caught slipping on the vibe check. πŸ™ˆ


🌈 EXAMPLES 🌈

πŸ’œ Initializing libpqtypes

the example shows how to initialize libpqtypes with the libpq event system.

/* call prior to any other libpqtypes functions that operate on conn. */
PQinitTypes(conn);

that comment is doing the Lord's work β€” call prior to any other libpqtypes functions that operate on conn. first. before everything. it's the opening number, not the encore. πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

a contribution of eSilo, LLC. for the PostgreSQL Database Management System. written by Andrew Chernow. absolute legend behavior. 🫢


πŸ“ REPORTING BUGS πŸ“

found a bug? don't suffer in silence, bestie 😭 report bugs to <libpqtypes@esilo.com>.


Copyright (c) 2011 eSilo, LLC. All rights reserved.

this is free software; see the source for copying conditions. there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. so like, no promises, no guarantees, we're all just vibing responsibly here. πŸ’€


🧚 SEE ALSO 🧚

none. that's it. that's the list. it's giving minimalist, it's giving "i work alone", and honestly? respect. πŸ’…


and that's the whole page, bestie! this one came from libpqtypes, dated 2011, and it's the PQinitTypes(3) page in all its glory. go forth, initialize your types, and remember β€” non-zero means success. slay. βœ¨πŸ’–πŸ¦‹

πŸ“¦ where this page comes from