Preventing SQL Injection in PL/pgSQL in psql
От
Karen Hill
Тема
Preventing SQL Injection in PL/pgSQL in psql
Дата
Msg-id
1147219471.500510.248860@i40g2000cwc.googlegroups.com
Список
Дерево обсуждения
Preventing SQL Injection in PL/pgSQL in psql "Karen Hill" <karen_hill22@yahoo.com>
Re: Preventing SQL Injection in PL/pgSQL in psql "Merlin Moncure" <mmoncure@gmail.com>
Re: Preventing SQL Injection in PL/pgSQL in psql Tom Lane <tgl@sss.pgh.pa.us>
Is my understanding correct that the following is vulnerable to SQL injection in psql: CREATE OR REPLACE FUNCTION fx ( my_var bchar) RETURNS void AS $$ BEGIN INSERT INTO fx VALUES ( my_var ) ; END; $$ LANGUAGE 'plpgsql' VOLATILE Where this is NOT subject to SQL injection: CREATE OR REPLACE FUNCTION fx ( my_var bpchar) RETURNS void AS $$ BEGIN EXECUTE ' INSERT INTO fx VALUES ( ' || quote_literal( my_var) || ' ); ' END; $$ LANGUAGE 'plpgsql' VOLATILE Is this understanding correct?
В списке pgsql-general по дате отправления