Skip to content

Commit

Permalink
More descriptive bool name for whether POSIX ID in use
Browse files Browse the repository at this point in the history
  • Loading branch information
haatveit committed Jan 6, 2025
1 parent 56df057 commit d37b5d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/identities.sql
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ create or replace function generate_new_posix_id(
returns int as $$
declare current_max_id int;
declare new_id int;
declare column_exists boolean;
declare posix_id_in_use boolean;
begin
execute format('select max(new_data::int) from %I where column_name = %s',
quote_ident(table_name), quote_literal(colum_name))
Expand All @@ -176,8 +176,8 @@ create or replace function generate_new_posix_id(
loop
execute format('select 1 from %I where %I = %s',
quote_ident(objects_table), quote_ident(colum_name), quote_literal(new_id))
into column_exists;
if column_exists then
into posix_id_in_use;
if posix_id_in_use then
new_id := new_id + 1;
else
return new_id;
Expand Down

0 comments on commit d37b5d5

Please sign in to comment.