Hi,
I need a trigger function created in plpgsql that performs the following:
On CREATE TABLE event, create a view for that table that returns all columns in snake_case as camelCase.
Example
For a table with the following columns: _id, first_name, last_name, email...
A view should be created that performs the following query:
SELECT _id, first_name AS firstName, last_name AS lastName, email FROM table_name;
Hi! I'm senior lecturer on databases with 10+ years experirnce in PostgreSQL. I propose use something like this command CREATE EVENT TRIGGER event_trg
ON DDL_COMMAND_START
WHEN tag IN ('CREATE TABLE')
if object='snake_case' EXECUTE PROCEDURE test_event_trigger();
CREATE FUNCTION test_event_trigger()
RETURNS event_trigger AS $$
BEGIN
CREATE VIEW camelCase AS
SELECT _id, first_name AS firstName, last_name AS lastName, email FROM table_name;
END
I didn't check this yet, may be it have some syntax error. But I can do this fast if you award me the project.
£20 GBP en 0 día
5,0 (23 comentarios)
4,7
4,7
4 freelancers están ofertando un promedio de £21 GBP por este trabajo
i am a software engineer...searching for a part-time job for extra money.i am a pl/sql developer working in a private company and searching for a extra money for my family...so plz give me project