diff options
Diffstat (limited to 'sql')
-rwxr-xr-x | sql/Pg-tables.sql | 4 | ||||
-rw-r--r-- | sql/Pg-upgrade-2.6.18-2.6.19.sql | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sql/Pg-tables.sql b/sql/Pg-tables.sql index 5201e55e..c9771e4d 100755 --- a/sql/Pg-tables.sql +++ b/sql/Pg-tables.sql @@ -761,10 +761,10 @@ INSERT INTO users_conf(id,password) VALUES (currval('users_id_seq'),NULL); CREATE FUNCTION create_user(text) RETURNS int4 AS $$ INSERT INTO users(username) VALUES ('$1'); - SELECT 1; + SELECT currval('user_id_seq'); $$ LANGUAGE 'SQL'; -COMMENT ON FUNCTION create_user(text) IS $$ Function to create user. Returns 1 if successful, else it is an error. $$; +COMMENT ON FUNCTION create_user(text) IS $$ Function to create user. Returns users.id if successful, else it is an error. $$; CREATE FUNCTION update_user(int4,text) RETURNS int4 AS $$ UPDATE users SET username = '$2' WHERE id = $1; diff --git a/sql/Pg-upgrade-2.6.18-2.6.19.sql b/sql/Pg-upgrade-2.6.18-2.6.19.sql index ce34ab29..924bd0ba 100644 --- a/sql/Pg-upgrade-2.6.18-2.6.19.sql +++ b/sql/Pg-upgrade-2.6.18-2.6.19.sql @@ -195,10 +195,10 @@ COMMIT; CREATE FUNCTION create_user(text) RETURNS int4 AS $$ INSERT INTO users(username) VALUES ('$1'); - SELECT 1; + SELECT currval('user_id_seq'); $$ LANGUAGE 'SQL'; -COMMENT ON FUNCTION create_user(text) IS $$ Function to create user Returns 1 if successful, else it is an error. $$; +COMMENT ON FUNCTION create_user(text) IS $$ Function to create user Returns users.id if successful, else it is an error. $$; CREATE FUNCTION update_user(int4,text) RETURNS int4 AS $$ UPDATE users SET username = '$2' WHERE id = $1; |