aboutsummaryrefslogtreecommitdiff
path: root/src/include/catalog/pg_constraint.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-09-03 01:34:55 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-09-03 01:34:55 +0000
commit303696c3b47e6719e983e93da5896ddc4a2e0dbb (patch)
tree0cf979aeaf94f5f4c45948c3db78755d08dde5a6 /src/include/catalog/pg_constraint.h
parent8ab6a6b4562efcd9f320353d5438fdbe10dbf9c5 (diff)
downloadpostgresql-REL9_1_ALPHA1.tar.gz
postgresql-REL9_1_ALPHA1.zip
Install a data-type-based solution for protecting pg_get_expr().REL9_1_ALPHA1
Since the code underlying pg_get_expr() is not secure against malformed input, and can't practically be made so, we need to prevent miscreants from feeding arbitrary data to it. We can do this securely by declaring pg_get_expr() to take a new datatype "pg_node_tree" and declaring the system catalog columns that hold nodeToString output to be of that type. There is no way at SQL level to create a non-null value of type pg_node_tree. Since the backend-internal operations that fill those catalog columns operate below the SQL level, they are oblivious to the datatype relabeling and don't need any changes.
Diffstat (limited to 'src/include/catalog/pg_constraint.h')
-rw-r--r--src/include/catalog/pg_constraint.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/catalog/pg_constraint.h b/src/include/catalog/pg_constraint.h
index 63fddc697bc..bbfd5767339 100644
--- a/src/include/catalog/pg_constraint.h
+++ b/src/include/catalog/pg_constraint.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_constraint.h,v 1.41 2010/08/07 02:44:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_constraint.h,v 1.42 2010/09/03 01:34:55 tgl Exp $
*
* NOTES
* the genbki.pl script reads this file and generates .bki
@@ -129,7 +129,7 @@ CATALOG(pg_constraint,2606)
/*
* If a check constraint, nodeToString representation of expression
*/
- text conbin;
+ pg_node_tree conbin;
/*
* If a check constraint, source-text representation of expression