Re: determine what column(s) form the primary key, in C extention

From: James Sewell <james(dot)sewell(at)gmail(dot)com>
To: alex maslakov <alex(at)serendipia(dot)email>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: determine what column(s) form the primary key, in C extention
Date: 2020-08-31 06:56:21
Message-ID: CAJe2zgMxLPPQM1BFDo27Wz9W3cq6zTZSFB31Kqg+DoPrKH2wMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers 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 <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.

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2020-08-31 11:11:11 pgsql: Fix docs bug stating file_fdw requires absolute paths
Previous Message Tom Lane 2020-08-30 20:03:41 pgsql: Mark factorial operator, and postfix operators in general, as de

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-08-31 07:42:21 Re: When are largobject records TOASTed into pg_toast_2613?
Previous Message Ron 2020-08-31 05:37:00 Re: Postgres DB hacked.