Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
Fwd: Segmentation fault on RelationGetDescr in my first extension - Mailing list pgsql-general
From
Дмитрий Цветков
Subject
Fwd: Segmentation fault on RelationGetDescr in my first extension
Date
December 29, 2022
10:52:18
Msg-id
CALS6dkRaXHV1Od5Xt1zyEUKdhHfE5WrL1sq062Pp_eMw-rZ=DA@mail.gmail.com
Whole thread
Raw
Responses
Re: Segmentation fault on RelationGetDescr in my first extension
List
pgsql-general
Tree view
Hi!
I'm trying to write my first extension and open a table in it.
I use check_password_hook and my function executes at the moment of changing user password.
But if I try to open a table inside this function, I get Segmentation fault on the line with "RelationGetDescr".
What am I doing wrong?
void
_PG_init(void)
{
prev_check_password_hook = check_password_hook;
check_password_hook = check_password;
}
...
void check_password(const char *username, const char *shadow_pass, PasswordType password_type, Datum validuntil_time, bool validuntil_null)
{
Relation rel;
TupleDesc tupdesc;
int Natts;
Oid tbl_oid = DatumGetObjectId(DirectFunctionCall1(to_regclass, CStringGetTextDatum("my_test_table")));
if (OidIsValid(tbl_oid)) {
rel = table_open(tbl_oid, RowExclusiveLock);
tupdesc = RelationGetDescr(rel); // !!! server process (PID 70525) was terminated by signal 11: Segmentation fault
Natts = tupdesc->natts;
table_close(rel, RowExclusiveLock);
} else {
ereport(NOTICE, (errmsg("IndexRelationId (%d) is NOT valid !", tbl_oid)));
}
}
Table is fine:
postgres=# \d my_test_table
Table "public.my_test_table"
Column | Type | Collation | Nullable | Default
--------+------+-----------+----------+---------
name | text | | |
pgsql-general
by date:
Previous
From:
Melih Mutlu
Date:
29 December 2022, 09:51:45
Subject:
Re: https://wiki.postgresql.org/wiki/Working_with_Git link one link cannot open, another link is unrelated.
Next
From:
Ranjith Paliyath
Date:
30 December 2022, 06:39:33
Subject:
Purging few months old data and vacuuming in production
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies