Thread: How come column is locked?

How come column is locked?

From
Shaozhong SHI
Date:
Hi, 

I used

create table if not exists waternetwork1.walknetwortt3 (fid integer[]);

in do statement.

When I use
insert into waternetwork1.walknetwortt3 select fid from a function

it failed.

The column is locked.

Regards,

David

Re: How come column is locked?

From
William Alves Da Silva
Date:
Hello,

In PostgreSQL, DDL statements will get lock, if you don’t commit the change, all futures queries will be put on hold.

Reggards,
WIlliam Alves

> On 4 Jul 2023, at 11:34, Shaozhong SHI <shishaozhong@gmail.com> wrote:
>
> Hi,
>
> I used
>
> create table if not exists waternetwork1.walknetwortt3 (fid integer[]);
>
> in do statement.
>
> When I use
> insert into waternetwork1.walknetwortt3 select fid from a function
>
> it failed.
>
> The column is locked.
>
> Regards,
>
> David




Re: How come column is locked?

From
Thomas Kellerer
Date:
Shaozhong SHI schrieb am 04.07.2023 um 16:34:
> I used
>
> create table if not exists waternetwork1.walknetwortt3 (fid integer[]);
>
> in do statement.
>
> When I use
> insert into waternetwork1.walknetwortt3 select fid from a function
>
> it failed.

What exactly is the error message you get?


> The column is locked.

There is no column level lock in Postgres.

The smallest unit that can be locked is a row.




Re: How come column is locked?

From
Tom Lane
Date:
Shaozhong SHI <shishaozhong@gmail.com> writes:
> I used
> create table if not exists waternetwork1.walknetwortt3 (fid integer[]);
> in do statement.

Perhaps the table already existed, with some other column list?

> When I use
> insert into waternetwork1.walknetwortt3 select fid from a function
> it failed.

"It failed" is totally inadequate as a description of the problem.
Did you read the error message?  What does it say, exactly?

            regards, tom lane



Re: How come column is locked?

From
Thomas Kellerer
Date:
Shaozhong SHI schrieb am 04.07.2023 um 16:59:
> On Tue, 4 Jul 2023 at 15:43, Thomas Kellerer <shammat@gmx.net <mailto:shammat@gmx.net>> wrote:
>
>     Shaozhong SHI schrieb am 04.07.2023 um 16:34:
>      > I used
>      >
>      > create table if not exists waternetwork1.walknetwortt3 (fid integer[]);
>      >
>      > in do statement.
>      >
>      > When I use
>      > insert into waternetwork1.walknetwortt3 select fid from a function
>      >
>      > it failed.
>
>     What exactly is the error message you get?
>
>
>      > The column is locked.
>
>     There is no column level lock in Postgres.
>
>     The smallest unit that can be locked is a row.
>
>
>
>
> I see a pad lock on the column.  That is the only column.

There is no such thing as a "padlock" in Postgres.





Re: How come column is locked?

From
Rob Sargent
Date:
On 7/4/23 12:39, Thomas Kellerer wrote:
Shaozhong SHI schrieb am 04.07.2023 um 16:59:
On Tue, 4 Jul 2023 at 15:43, Thomas Kellerer <shammat@gmx.net <mailto:shammat@gmx.net>> wrote:

    Shaozhong SHI schrieb am 04.07.2023 um 16:34:
     > I used
     >
     > create table if not exists waternetwork1.walknetwortt3 (fid integer[]);
     >
     > in do statement.
     >
     > When I use
     > insert into waternetwork1.walknetwortt3 select fid from a function
     >
     > it failed.

    What exactly is the error message you get?


     > The column is locked.

    There is no column level lock in Postgres.

    The smallest unit that can be locked is a row.




I see a pad lock on the column.  That is the only column.

There is no such thing as a "padlock" in Postgres.




GUI-speak for primary key, perhaps?