From: Robert Buels Date: Fri, 4 Sep 2009 17:43:17 +0000 (+0000) Subject: added big block comment explaining Pg sequence discovery strategy X-Git-Tag: v0.08111~14^2~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=46ae368dd29448a47593c7e3d3ec5c18f5c7cc79;p=dbsrgits%2FDBIx-Class.git added big block comment explaining Pg sequence discovery strategy --- diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index 61a8d5e..d13f48a 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -54,6 +54,22 @@ sub _dbh_get_autoinc_seq { ( $schema, $table ) = ( $1, $2 ); } + # Build and execute a query into the pg_catalog to find the Pg + # expression for the default value for this column in this table. + # If the table name is schema-qualified, query using that specific + # schema name. + + # Otherwise, find the table in the standard Postgres way, using the + # search path. This is done with the pg_catalog.pg_table_is_visible + # function, which returns true if a given table is 'visible', + # meaning the first table of that name to be found in the search + # path. + + # I *think* we can be assured that this query will always find the + # correct column according to standard Postgres semantics. + # + # -- rbuels + my $sqlmaker = $self->sql_maker; local $sqlmaker->{bindtype} = 'normal';