Questions about this topic? Sign up to ask in the talk tab.

Difference between revisions of "SQL injection/Target Environments/Mapping/PostgreSQL"

From NetSec
Jump to: navigation, search
Line 1: Line 1:
<noinclude>{{subpage|SQL injection}}</noinclude>
+
<noinclude>:<font size="-2">[[SQL injection]] > [[SQL injection/Target Environments|Target Environments]] > [[SQL injection/Target Environments/Mapping|Mapping]] > PostgreSQL</font></noinclude>
 +
 
 
'''PostgreSQL''' has the '''current_database()''' function in stead of the '''database()''' function.
 
'''PostgreSQL''' has the '''current_database()''' function in stead of the '''database()''' function.
  
Line 13: Line 14:
  
 
{{code|text=<source lang="sql">select column_name from information_schema.columns where table_name=([table_query]) and table_schema=([schema_query]) and catalog_name=[database_name]</source>}}
 
{{code|text=<source lang="sql">select column_name from information_schema.columns where table_name=([table_query]) and table_schema=([schema_query]) and catalog_name=[database_name]</source>}}
 +
 +
 +
<noinclude><div style="padding-top:5px; padding-bottom:5px; border-top:1px solid; border-bottom:1px solid; display:inline-block;">'''Currently viewing''' [[SQL injection]] > [[SQL injection/Target Environments|Target Environments]] > [[SQL injection/Target Environments/Mapping|Mapping]] > PostgreSQL</div></noinclude>

Revision as of 03:14, 19 July 2012

SQL injection > Target Environments > Mapping > PostgreSQL

PostgreSQL has the current_database() function in stead of the database() function.

  • \dn equivalent:
SELECT schema_name FROM information_schema.schemata WHERE catalog_name=[DATABASE name]
  • \dt equivalent:
SELECT TABLE_NAME FROM information_schema.tables table_type='BASE TABLE' AND table_schema=([schema_query]) AND catalog_name=[DATABASE name]
  • \d [column_name] equivalent:
SELECT column_name FROM information_schema.columns WHERE TABLE_NAME=([table_query]) AND table_schema=([schema_query]) AND catalog_name=[database_name]


Currently viewing SQL injection > Target Environments > Mapping > PostgreSQL