Skip to content

Instantly share code, notes, and snippets.

@aguimaraes
Created August 28, 2014 18:13
Show Gist options
  • Select an option

  • Save aguimaraes/8980c8a23ad9b3111be8 to your computer and use it in GitHub Desktop.

Select an option

Save aguimaraes/8980c8a23ad9b3111be8 to your computer and use it in GitHub Desktop.
2014-08-14 14:14:37 BRT [alfa] LOG: executar pdo_stmt_00000003: SELECT
a.attnum,
n.nspname,
c.relname,
a.attname AS colname,
t.typname AS type,
a.atttypmod,
FORMAT_TYPE(a.atttypid, a.atttypmod) AS complete_type,
d.adsrc AS default_value,
a.attnotnull AS notnull,
a.attlen AS length,
co.contype,
ARRAY_TO_STRING(co.conkey, ',') AS conkey
FROM pg_attribute AS a
JOIN pg_class AS c ON a.attrelid = c.oid
JOIN pg_namespace AS n ON c.relnamespace = n.oid
JOIN pg_type AS t ON a.atttypid = t.oid
LEFT OUTER JOIN pg_constraint AS co ON (co.conrelid = c.oid
AND a.attnum = ANY(co.conkey) AND co.contype = 'p')
LEFT OUTER JOIN pg_attrdef AS d ON d.adrelid = c.oid AND d.adnum = a.attnum
WHERE a.attnum > 0 AND c.relname = 'invoices' ORDER BY a.attnum
2014-08-14 14:14:37 BRT [alfa] LOG: comando: DEALLOCATE pdo_stmt_00000003
2014-08-14 14:14:37 BRT [alfa] LOG: executar pdo_stmt_00000004: SELECT "invoices".* FROM "invoices" WHERE ((owner_id = 1 OR owner_id = 6484)) ORDER BY "id" DESC LIMIT 40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment