pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
access method xxx does not exist
7+ messages / 3 participants
[nested] [flat]

* access method xxx does not exist
@ 2022-10-29 11:19  jacktby@gmail.com <jacktby@gmail.com>
  0 siblings, 2 replies; 7+ messages in thread

From: jacktby@gmail.com @ 2022-10-29 11:19 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>


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


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* 回复: access method xxx does not exist
@ 2022-10-29 11:21  jacktby@gmail.com <jacktby@gmail.com>
  parent: jacktby@gmail.com <jacktby@gmail.com>
  1 sibling, 0 replies; 7+ messages in thread

From: jacktby@gmail.com @ 2022-10-29 11:21 UTC (permalink / raw)
  To: jacktby@gmail.com <jacktby@gmail.com>; pgsql-general <pgsql-general@lists.postgresql.org>


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


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: access method xxx does not exist
@ 2022-10-29 12:00  Peter J. Holzer <hjp-pgsql@hjp.at>
  parent: jacktby@gmail.com <jacktby@gmail.com>
  1 sibling, 1 reply; 7+ messages in thread

From: Peter J. Holzer @ 2022-10-29 12:00 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

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!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Re: access method xxx does not exist
@ 2022-10-29 12:15  jacktby@gmail.com <jacktby@gmail.com>
  parent: Peter J. Holzer <hjp-pgsql@hjp.at>
  0 siblings, 1 reply; 7+ messages in thread

From: jacktby@gmail.com @ 2022-10-29 12:15 UTC (permalink / raw)
  To: Peter J. Holzer <hjp-pgsql@hjp.at>; pgsql-general <pgsql-general@lists.postgresql.org>

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!"


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: access method xxx does not exist
@ 2022-10-29 13:27  Julien Rouhaud <rjuju123@gmail.com>
  parent: jacktby@gmail.com <jacktby@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Julien Rouhaud @ 2022-10-29 13:27 UTC (permalink / raw)
  To: jacktby@gmail.com <jacktby@gmail.com>; +Cc: Peter J. Holzer <hjp-pgsql@hjp.at>; pgsql-general <pgsql-general@lists.postgresql.org>

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.





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Re: access method xxx does not exist
@ 2022-10-29 13:43  jacktby@gmail.com <jacktby@gmail.com>
  parent: Julien Rouhaud <rjuju123@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: jacktby@gmail.com @ 2022-10-29 13:43 UTC (permalink / raw)
  To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: Peter J. Holzer <hjp-pgsql@hjp.at>; pgsql-general <pgsql-general@lists.postgresql.org>

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.


^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: access method xxx does not exist
@ 2022-10-29 14:06  Julien Rouhaud <rjuju123@gmail.com>
  parent: jacktby@gmail.com <jacktby@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Julien Rouhaud @ 2022-10-29 14:06 UTC (permalink / raw)
  To: jacktby@gmail.com <jacktby@gmail.com>; +Cc: Peter J. Holzer <hjp-pgsql@hjp.at>; pgsql-general <pgsql-general@lists.postgresql.org>

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
> 
> <html><head></head><body><div class=3D"">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?</div><div>&nbsp;</div><hr style=3D"WIDTH: 210px; HEIGHT: 1px" co=
> lor=3D"#b5c4df" size=3D"1" align=3D"left"><div><span><div style=3D"MARGIN: =
> 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>jacktby@gmail.com</div></=
> div></span></div><blockquote style=3D"margin-Top: 0px; margin-Bottom: 0px; =
> margin-Left: 0.5em; margin-Right: inherit"><div>&nbsp;</div><div style=3D"b=
> order:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div s=
> tyle=3D"PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:=
> tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP=
> : 8px"><div><b>From:</b>&nbsp;<a href=3D"mailto:rjuju123@gmail.com">Julien =
> Rouhaud</a></div><div><b>Date:</b>&nbsp;2022-10-29&nbsp;21:27</div><div><b>=
> To:</b>&nbsp;<a href=3D"mailto:jacktby@gmail.com">jacktby@gmail.com</a></di=
> v><div><b>CC:</b>&nbsp;<a href=3D"mailto:hjp-pgsql@hjp.at">Peter J. Holzer<=
> /a>; <a href=3D"mailto:pgsql-general@lists.postgresql.org">pgsql-general</a=
> ></div><div><b>Subject:</b>&nbsp;Re: access method xxx does not exist</div>=
> </div></div><div><div class=3D""><style>div.FoxDIV_20221029212802774 { font=
> -size: 10.5pt }
> </style><div style=3D"heigh

First, please don't top post here and configure your MUA to stop sending
html-only weirdly formatted emails
(https://wiki.postgresql.org/wiki/Mailing_Lists#Email_etiquette_mechanics),
many people (and the archives) can't work with it.

Then, yes it should but it's impossible to know what you did wrong without more
details.  And in any case, if you want to add a new index AM, you should
probably create it as an extension, like bloom, rather than putting in postgres
source code.





^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2022-10-29 14:06 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 11:19 access method xxx does not exist jacktby@gmail.com <jacktby@gmail.com>
2022-10-29 11:21 ` 回复: access method xxx does not exist jacktby@gmail.com <jacktby@gmail.com>
2022-10-29 12:00 ` Peter J. Holzer <hjp-pgsql@hjp.at>
2022-10-29 12:15   ` jacktby@gmail.com <jacktby@gmail.com>
2022-10-29 13:27     ` Julien Rouhaud <rjuju123@gmail.com>
2022-10-29 13:43       ` jacktby@gmail.com <jacktby@gmail.com>
2022-10-29 14:06         ` Julien Rouhaud <rjuju123@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox