mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-01 19:45:33 +08:00
Update example: PgLargeObject constructor now takes a conninfo string,
not a bare database name.
This commit is contained in:
parent
6caa4fa406
commit
51c92941c6
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/examples/Attic/testlo.cc,v 1.5 1999/12/03 18:28:32 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/examples/Attic/testlo.cc,v 1.6 2000/04/22 22:15:48 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -19,22 +19,22 @@ int main(int argc, char **argv)
|
||||
{
|
||||
// Check if the program was invoked correctly; if not, signal error
|
||||
if (argc < 4 || argc > 5) {
|
||||
cerr << "Usage: " << argv[0] << " database_name in_filename out_filename [oid]" << endl;
|
||||
cerr << "Usage: " << argv[0] << " conninfo_str in_filename out_filename [oid]" << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Get the arguments passed to the program
|
||||
char* database = argv[1];
|
||||
char* conninfo = argv[1];
|
||||
char* in_filename = argv[2];
|
||||
char* out_filename = argv[3];
|
||||
|
||||
// Set up the connection and create a large object
|
||||
int lobjId = ( argc == 4 ? 0 : atoi(argv[4]) );
|
||||
PgLargeObject object(lobjId, database);
|
||||
PgLargeObject object(lobjId, conninfo);
|
||||
|
||||
// check to see that the backend connection was successfully made
|
||||
if ( object.ConnectionBad() ) {
|
||||
cerr << "Connection to database '" << database << "' failed." << endl
|
||||
cerr << "Connection with conninfo '" << conninfo << "' failed." << endl
|
||||
<< object.ErrorMessage();
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user