Re: determine what column(s) form the primary key, in C extention - Mailing list pgsql-general

From James Sewell
Subject Re: determine what column(s) form the primary key, in C extention
Date
Msg-id CAJe2zgMxLPPQM1BFDo27Wz9W3cq6zTZSFB31Kqg+DoPrKH2wMQ@mail.gmail.com
Whole thread Raw
In response to Re: determine what column(s) form the primary key, in C extention  (alex maslakov <alex@serendipia.email>)
List pgsql-general
(2)

I'll use this C code as an example to build an extention in Rust. The
Postgresql bindings for Rust I have don't contain a definition of
`FirstLowInvalidHeapAttributeNumber` for some reason. I can define it
since it's simply single digit constant.

Not an answer to your question - but use better bindings! https://github.com/zombodb/pgx 

[nix-shell:~/rust/pgx_master]$ grep -R FirstLowInvalidHeapAttributeNumber pgx-pg-sys/
pgx-pg-sys/generated-bindings/pg12_specific.rs:pub const FirstLowInvalidHeapAttributeNumber: i32 = -7;


Which is obviously not quite right still, so I pushed a version with some extra includes. Now you will get:

[nix-shell:~/rust/pgx_master]$ grep -R FirstLowInvalidHeapAttributeNumber ./pgx-pg-sys/
./pgx-pg-sys/generated-bindings/pg10_specific.rs:pub const FirstLowInvalidHeapAttributeNumber: i32 = -8;
./pgx-pg-sys/generated-bindings/pg12_specific.rs:pub const FirstLowInvalidHeapAttributeNumber: i32 = -7;
./pgx-pg-sys/generated-bindings/pg11_specific.rs:pub const FirstLowInvalidHeapAttributeNumber: i32 = -8;


You'll need to use the Github version not the crates.io until the next release if you want all the versions.




pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: Postgres DB hacked.
Next
From: Laurenz Albe
Date:
Subject: Re: When are largobject records TOASTed into pg_toast_2613?