PQparamtype
I already see that 16387 is not a ‘constant’, if I have few custom types I got different numbers for them
thanks
dm
On Sep 1, 2022, at 12:49 AM, David Rowley <dgrowleyml@gmail.com> wrote:(I think this is a better question for the general mailing list)On Thu, 1 Sept 2022 at 16:28, Dmitry Markman <dmarkman@mac.com> wrote:Hi, when I’m trying to access values of my custom enum type I created withcreate type colors as enum ('red', 'green', 'brown', 'yellow', 'blue');I’m getting oid as 16387 and I can see it stored as a charsYou might see the names if you query the table, but all that's storedin the table is the numerical value.https://www.postgresql.org/docs/current/datatype-enum.html states "Anenum value occupies four bytes on disk.".is number 16387 is always OID for enum type?I'm not sure where you got that number from. Perhaps it's the oid forthe pg_type record? The following would show it.select oid,typname from pg_type where typname = 'colors';if not how I can get information about type of the result if it’s custom enum typeI'm not sure what you mean by "the result". Maybe pg_typeof(column)might be what you want? You can do: SELECT pg_typeof(myenumcol) FROMmytable;David
Hi, when I’m trying to access values of my custom enum type I created withcreate type colors as enum ('red', 'green', 'brown', 'yellow', 'blue');I’m getting oid as 16387 and I can see it stored as a chars
is number 16387 is always OID for enum type?
if not how I can get information about type of the result if it’s custom enum type
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных