[GENERAL] Unique constraint and unique index

2013-08-21 Thread Ivan Radovanovic
Just to verify: - when unique constraint is created using appropriate syntax rows are added to tables pg_constraint and pg_index (pg_constraint with type 'u' and referring to index with indisunique set to true) - when unique index is created row is added only to pg_index table but not to pg_con

Re: [GENERAL] Bug in psql (\dd query)

2013-08-21 Thread Ivan Radovanovic
On 08/21/13 16:34, Ivan Radovanovic napisa: On 08/21/13 16:03, Tom Lane napisa: Ivan Radovanovic writes: I was checking for way to get object comments, and it seems that \dd has bug when it comes to extracting descriptions for constraints. That code looks right to me, and it works according

Re: [GENERAL] Bug in psql (\dd query)

2013-08-21 Thread Ivan Radovanovic
On 08/21/13 16:03, Tom Lane napisa: Ivan Radovanovic writes: I was checking for way to get object comments, and it seems that \dd has bug when it comes to extracting descriptions for constraints. That code looks right to me, and it works according to a simple test: d1=# create table foo (f1

[GENERAL] Bug in psql (\dd query)

2013-08-21 Thread Ivan Radovanovic
Hello, I was checking for way to get object comments, and it seems that \dd has bug when it comes to extracting descriptions for constraints. Relevant part of query psql is executing is: SELECT DISTINCT tt.nspname AS "Schema", tt.name AS "Name", tt.object AS "Object", d.description AS "Descr

Re: [GENERAL] Getting list of supported types in Postgres

2013-08-15 Thread Ivan Radovanovic
On 08/15/13 17:27, Adrian Klaver napisa: On 08/15/2013 08:07 AM, Ivan Radovanovic wrote: On 08/15/13 16:59, Adrian Klaver napisa: On 08/15/2013 07:53 AM, Ivan Radovanovic wrote: Now I just need to find out which types can be indexed (and which types can be part of PK) http

Re: [GENERAL] Getting list of supported types in Postgres

2013-08-15 Thread Ivan Radovanovic
On 08/15/13 17:15, Tom Lane napisa: Ivan Radovanovic writes: Thanks Adrian, but question was how to decide which types are indexable A little bit of research in the system-catalogs documentation will show you how to find the types that can be accepted by some index opclass (hint

Re: [GENERAL] Getting list of supported types in Postgres

2013-08-15 Thread Ivan Radovanovic
On 08/15/13 16:59, Adrian Klaver napisa: On 08/15/2013 07:53 AM, Ivan Radovanovic wrote: Now I just need to find out which types can be indexed (and which types can be part of PK) http://www.postgresql.org/docs/9.2/interactive/indexes.html doesn't list which types can be indexe

Re: [GENERAL] Getting list of supported types in Postgres

2013-08-15 Thread Ivan Radovanovic
On 08/15/13 16:49, Adrian Klaver napisa: On 08/15/2013 07:37 AM, Ivan Radovanovic wrote: On 08/15/13 16:30, Adrian Klaver napisa: On 08/15/2013 02:33 AM, Ivan Radovanovic wrote: On 08/15/13 05:23, Michael Paquier napisa: On Thu, Aug 15, 2013 at 6:00 AM, Bruce Momjian wrote: Try psql -E, and

Re: [GENERAL] Getting list of supported types in Postgres

2013-08-15 Thread Ivan Radovanovic
On 08/15/13 16:30, Adrian Klaver napisa: On 08/15/2013 02:33 AM, Ivan Radovanovic wrote: On 08/15/13 05:23, Michael Paquier napisa: On Thu, Aug 15, 2013 at 6:00 AM, Bruce Momjian wrote: Try psql -E, and run the \dT command to see the query it uses. You have also the following commands: - ¥dT

Re: [GENERAL] Getting list of supported types in Postgres

2013-08-15 Thread Ivan Radovanovic
On 08/15/13 05:23, Michael Paquier napisa: On Thu, Aug 15, 2013 at 6:00 AM, Bruce Momjian wrote: Try psql -E, and run the \dT command to see the query it uses. You have also the following commands: - ¥dT+, all types with addition information like its size ('var' is for example variable length)

[GENERAL] Getting list of supported types in Postgres

2013-08-14 Thread Ivan Radovanovic
Hi guys, I am looking for a way to get list of supported types in Postgres together with information whether type can have optional size (like varchar for example), whether it can have precision (like decimal for example), and whether it can come as value of sequence (like all integer types f

[GENERAL] Querying information_schema [bug?]

2012-11-23 Thread Ivan Radovanovic
Hello, I couldn't find anything mentioned about this in documentation and googling didn't help either: - if I connect to database as user who doesn't have permission to access all schemas then querying information_schema.schemata returns no rows (querying information_schema.tables returns only

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Ivan Radovanovic
On 01/25/12 20:02, Misa Simic napisa: Thanks Bill, Make sense... db_link is probably then solution... Everything depends on concrete problem... But I still think security should be reconsidered (I would use db_link just in case there is no other options - if we must let users to have direct ac

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Ivan Radovanovic
On 01/25/12 18:38, Greg Sabino Mullane napisa: You would need to break out of the transaction somehow within that function and make a new call to the database, for example using dblink or plperlu. I've done the latter before and it wasn't too painful. The general idea is: - --- $dbh = DBI->conn

[GENERAL] Logging access to data in database table

2012-01-25 Thread Ivan Radovanovic
Hello, I need to log access to certain data in database in some log (I prefer to have that both in syslog and table in database), and I find it easy to write to syslog, but I can't solve the problem of writing this to database table. If this protected data is read only using postgres functio