access method xxx does not exist
access method xxx does not exist
От:
"jacktby@gmail.com" <jacktby@gmail.com>
Дата:
I'm trying to add a new index, but when I finish it, I use “ create index xxx_index on t1 using xxx(a); ”,it gives me access method "my_index" does not exist
And I don't know where this message is from, can you grve me its position? I do like this. I add oid in pg_am.dat and pg_proc.dat for my index. And I add codes in contrib and backend/access/myindex_name, is there any other places I need to add some infos? Who can help me?
And I don't know where this message is from, can you grve me its position? I do like this. I add oid in pg_am.dat and pg_proc.dat for my index. And I add codes in contrib and backend/access/myindex_name, is there any other places I need to add some infos? Who can help me?
jacktby@gmail.com
回复: access method xxx does not exist
От:
"jacktby@gmail.com" <jacktby@gmail.com>
Дата:
I debug and when it comes to "tuple = SearchSysCache1(AMNAME, PointerGetDatum(accessMethodName));", the tuple is NULL.so it gives me access method doesn't exist
jacktby@gmail.com
I'm trying to add a new index, but when I finish it, I use “ create index xxx_index on t1 using xxx(a); ”,it gives me access method "my_index" does not exist
And I don't know where this message is from, can you grve me its position? I do like this. I add oid in pg_am.dat and pg_proc.dat for my index. And I add codes in contrib and backend/access/myindex_name, is there any other places I need to add some infos? Who can help me?jacktby@gmail.com
Re: access method xxx does not exist
On 2022-10-29 19:19:28 +0800, jacktby@gmail.com wrote:
> I'm trying to add a new index, but when I finish it, I use “ create index
> xxx_index on t1 using xxx(a); ”,it gives me access method "my_index" does not
> exist
> And I don't know where this message is from, can you grve me its position?
See https://www.postgresql.org/docs/current/sql-createindex.html
The syntax for CREATE INDEX is
CREATE INDEX ON table_name [ USING method ] ( column_name ... )
You use USING to specify the method (e.g. btree or gin), not the table
and/or columns. The columns (or expressions come in parentheses after
that.
So if you wanted an index on column a of table t1 you would simply
write:
CREATE INDEX ON t1 (a);
Or if you have a function xxx and you want a function based index on
xxx(a) of that table:
CREATE INDEX ON t1 (xxx(a));
(You can specify the name of the index, but why would you?)
> I do like this. I add oid in pg_am.dat and pg_proc.dat for my index.
> And I add codes in contrib and backend/access/myindex_name, is there
> any other places I need to add some infos?
What? Why are you doing these things?
hp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
Re: Re: access method xxx does not exist
От:
"jacktby@gmail.com" <jacktby@gmail.com>
Дата:
No , that's not what I want, I'm not try to use an exsited index in pg15, I'm tring to build a new index by myself. Can you give me metrials to study it?
jacktby@gmail.com
From: Peter J. HolzerDate: 2022-10-29 20:00To: pgsql-generalSubject: Re: access method xxx does not existOn 2022-10-29 19:19:28 +0800, jacktby@gmail.com wrote:> I'm trying to add a new index, but when I finish it, I use “ create index> xxx_index on t1 using xxx(a); ”,it gives me access method "my_index" does not> exist> And I don't know where this message is from, can you grve me its position?The syntax for CREATE INDEX isCREATE INDEX ON table_name [ USING method ] ( column_name ... )You use USING to specify the method (e.g. btree or gin), not the tableand/or columns. The columns (or expressions come in parentheses afterthat.So if you wanted an index on column a of table t1 you would simplywrite:CREATE INDEX ON t1 (a);Or if you have a function xxx and you want a function based index onxxx(a) of that table:CREATE INDEX ON t1 (xxx(a));(You can specify the name of the index, but why would you?)> I do like this. I add oid in pg_am.dat and pg_proc.dat for my index.> And I add codes in contrib and backend/access/myindex_name, is there> any other places I need to add some infos?What? Why are you doing these things?hp--_ | Peter J. Holzer | Story must make more sense than reality.|_|_) | || | | hjp@hjp.at | -- Charles Stross, "Creative writing__/ | http://www.hjp.at/ | challenge!"
Re: access method xxx does not exist
От:
Julien Rouhaud <rjuju123@gmail.com>
Дата:
Hi, On Sat, Oct 29, 2022 at 08:15:54PM +0800, jacktby@gmail.com wrote: > On 2022-10-29 19:19:28 +0800, jacktby@gmail.com wrote: > > I'm trying to add a new index, but when I finish it, I use “ create index > > xxx_index on t1 using xxx(a); ”,it gives me access method "my_index" does not > > exist You should look at the bloom contrib in postgres source tree for an example of how to write a custom index AM.
Re: Re: access method xxx does not exist
От:
"jacktby@gmail.com" <jacktby@gmail.com>
Дата:
Yes,I just want to know if I add am in pg_am.dat, after I make install, it means the new access method is built? right?
jacktby@gmail.com
Hi,On Sat, Oct 29, 2022 at 08:15:54PM +0800, jacktby@gmail.com wrote:> On 2022-10-29 19:19:28 +0800, jacktby@gmail.com wrote:> > I'm trying to add a new index, but when I finish it, I use “ create index> > xxx_index on t1 using xxx(a); ”,it gives me access method "my_index" does not> > existYou should look at the bloom contrib in postgres source tree for an example ofhow to write a custom index AM.
Re: access method xxx does not exist
От:
Julien Rouhaud <rjuju123@gmail.com>
Дата:
Hi, On Sat, Oct 29, 2022 at 09:43:51PM +0800, jacktby@gmail.com wrote: > ------=_001_NextPart037628267087_=---- > Content-Type: text/html; charset="utf-8" > Content-Transfer-Encoding: quoted-printable > >Yes,I just want to know if I add a= > m in pg_am.dat, after I make install, it means the new access method is bui= > lt? right?
lor=3D"#b5c4df" size=3D"1" align=3D"left">10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">jacktby@gmail.comdiv>margin-Left: 0.5em; margin-Right: inherit">order:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">tyle=3D"PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:= > tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP= > : 8px">From: Julien = > RouhaudDate: 2022-10-29 21:27= > To: jacktby@gmail.com v>Subject: Re: access method xxx does not exist= >