pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18065: An error occurred when attempting to add a column of type "vector" to a table named "vector".
5+ messages / 4 participants
[nested] [flat]

* BUG #18065: An error occurred when attempting to add a column of type "vector" to a table named "vector".
@ 2023-08-22 09:06  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: PG Bug reporting form @ 2023-08-22 09:06 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: a17764530215@gmail.com

The following bug has been logged on the website:

Bug reference:      18065
Logged by:          kaijian xu
Email address:      a17764530215@gmail.com
PostgreSQL version: 15.3
Operating system:   Debian GNU/Linux 11
Description:        

When I run:
create table if not exists "vector" ();
alter table "vector" add column if not exists "fz_vector1_embedding"
vector(1536);

I got an error:
ERROR:  type modifier is not allowed for type "vector"
LINE 1: ..." add column if not exists "fz_vector1_embedding" vector(153...



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

* Re: BUG #18065: An error occurred when attempting to add a column of type "vector" to a table named "vector".
@ 2023-08-22 12:51  David G. Johnston <david.g.johnston@gmail.com>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2023-08-22 12:51 UTC (permalink / raw)
  To: a17764530215@gmail.com <a17764530215@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

On Tuesday, August 22, 2023, PG Bug reporting form <noreply@postgresql.org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference:      18065
> Logged by:          kaijian xu
> Email address:      a17764530215@gmail.com
> PostgreSQL version: 15.3
> Operating system:   Debian GNU/Linux 11
> Description:
>
> When I run:
> create table if not exists "vector" ();
> alter table "vector" add column if not exists "fz_vector1_embedding"
> vector(1536);
>
> I got an error:
> ERROR:  type modifier is not allowed for type "vector"
> LINE 1: ..." add column if not exists "fz_vector1_embedding" vector(153...
>
>
You are in the wrong place, core doesn’t have this type.

David J.

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

* Re: BUG #18065: An error occurred when attempting to add a column of type "vector" to a table named "vector".
@ 2023-08-22 13:26  Tom Lane <tgl@sss.pgh.pa.us>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2023-08-22 13:26 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: a17764530215@gmail.com <a17764530215@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, August 22, 2023, PG Bug reporting form <noreply@postgresql.org>
> wrote:
>> When I run:
>> create table if not exists "vector" ();
>> alter table "vector" add column if not exists "fz_vector1_embedding"
>> vector(1536);
>> I got an error:
>> ERROR:  type modifier is not allowed for type "vector"
>> LINE 1: ..." add column if not exists "fz_vector1_embedding" vector(153...

> You are in the wrong place, core doesn’t have this type.

I think it's basically a search path problem: the table's composite type
"vector" is masking the extension's type.  Try schema-qualifying "vector"
with the appropriate schema name.

			regards, tom lane





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

* Re: BUG #18065: An error occurred when attempting to add a column of type "vector" to a table named "vector".
@ 2023-08-22 13:45  David G. Johnston <david.g.johnston@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2023-08-22 13:45 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: a17764530215@gmail.com <a17764530215@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

On Tuesday, August 22, 2023, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> "David G. Johnston" <david.g.johnston@gmail.com> writes:
> > On Tuesday, August 22, 2023, PG Bug reporting form <
> noreply@postgresql.org>
> > wrote:
> >> When I run:
> >> create table if not exists "vector" ();
> >> alter table "vector" add column if not exists "fz_vector1_embedding"
> >> vector(1536);
> >> I got an error:
> >> ERROR:  type modifier is not allowed for type "vector"
> >> LINE 1: ..." add column if not exists "fz_vector1_embedding"
> vector(153...
>
> > You are in the wrong place, core doesn’t have this type.
>
> I think it's basically a search path problem: the table's composite type
> "vector" is masking the extension's type.  Try schema-qualifying "vector"
> with the appropriate schema name.
>
>
Right.  Though my conclusion is this is why you don’t name a table
something as generic as “vector”.  But still one should schema-qualify
their use of extension types anyway.

David J.

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

* Re: BUG #18065: An error occurred when attempting to add a column of type "vector" to a table named "vector".
@ 2023-08-23 11:40  kaijian xu <a17764530215@gmail.com>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: kaijian xu @ 2023-08-23 11:40 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Thank you for your help!
I didn't know that the table name was actually a type. I specified a schema
in front of the vector type, and the issue is resolved.

>

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


end of thread, other threads:[~2023-08-23 11:40 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22 09:06 BUG #18065: An error occurred when attempting to add a column of type "vector" to a table named "vector". PG Bug reporting form <noreply@postgresql.org>
2023-08-22 12:51 ` David G. Johnston <david.g.johnston@gmail.com>
2023-08-22 13:26   ` Tom Lane <tgl@sss.pgh.pa.us>
2023-08-22 13:45     ` David G. Johnston <david.g.johnston@gmail.com>
2023-08-23 11:40       ` kaijian xu <a17764530215@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