I have a strange problem with PostgreSQL. It indicates that a procedure does not exist while I think that I created it. I really do not understand. I tried to remove arguments only to see if I would have the same problem or another one but I still got the same problem...
Here is my code :
DROP TABLE IF EXISTS clients, accounts, transactions, failed_transactions CASCADE;
CREATE TABLE IF NOT EXISTS clients
(
id int PRIMARY KEY,
name varchar
);
CREATE TABLE IF NOT EXISTS accounts
(
id int PRIMARY KEY,
balance float,
client int,
FOREIGN KEY (client) REFERENCES clients(id),
CHECK (balance >= -500)
);
CREATE TABLE IF NOT EXISTS transactions
(
id serial PRIMARY KEY,
amount float
);
CREATE TABLE failed_transactions
(
id serial,
account_id integer,
attempted_amount float,
timestamp timestamp DEFAULT NOW()
);
CREATE OR REPLACE PROCEDURE log_failed_transaction(new_line record, old_line record)
LANGUAGE plpgsql
AS $$
BEGIN
IF new_line.balance
No comments:
Post a Comment
Thanks