note 94671 modified in function.pg-copy-from by danbrown

From: Date: Tue, 17 Nov 2009 19:31:01 +0000
Subject: note 94671 modified in function.pg-copy-from by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-163006@lists.php.net to get a copy of this message
This will not look in other schema's, only the schema's in your search path. You can temporarily change this behavior with the following code: <?php pg_query($conn, "SET search_path TO myschema;"); $copy_from = pg_copy_from($conn, 'tablename', $filetoarray, ","); if ( !$copy_from ) { echo pg_last_error($conn); exit; } pg_query("RESET search_path;"); ?> --was-- This will not look in other schema's, only the schema's in your search path. You can temporarily change this behavior with the following code: pg_query($conn, "SET search_path TO myschema;"); $copy_from = pg_copy_from($conn, 'tablename', $filetoarray, ","); if ( !$copy_from ) { echo pg_last_error($conn); exit; } pg_query("RESET search_path;"); http://php.net/manual/en/function.pg-copy-from.php

« previous php.notes (#163006) next »