C++ compile error: has initializer but incomplete type

Try using the -L flag with pg_restore by specifying the file taken from pg_dump -Fc

I am coding in Eclipse and have something like the following:

#include <ftream>
#include <iostream>


void read_file(){
char buffer[1025];
std::istringstream iss(buffer);
}

-L list-file

However, when I try to build, I get the following error: variable 'std::istringstream iss' has initializer but incomplete type

--use-list=list-file

Any quick thoughts? I have googled around and it seems like most people with this problem simply did not include the right header files which I believe I am doing correctly.

127460 次浏览

Restore only those archive elements that are listed in list-file, and restore them in the order they appear in the file. Note that if filtering switches such as -n or -t are used with -L, they will further restrict the items restored.

list-file is normally created by editing the output of a previous -l operation. Lines can be moved or removed, and can also be commented out by placing a semicolon (;) at the start of the line. See below for examples.

https://www.postgresql.org/docs/9.5/app-pgrestore.html

pg_dump -Fc -f pg.dump db_name
pg_restore -l pg.dump | grep -v 'COMMENT - EXTENSION' > pg_restore.list
pg_restore -L pg_restore.list pg.dump

You need this include:

#include <sstream>

` Please include either of these:

`#include<sstream>`


using std::istringstream;
ong>, and as we know by the docs, RDS instances are managed by Amazon. As such, to prevent you from breaking things like replication, your users - even the root user you set up when you create the instance - will not have full superuser privileges:

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html

When you create a DB instance, the master user system account that you

For people using AWS, the COMMENT ON EXTENSION is possible only as superuser, and as we know by the docs, RDS instances are managed by Amazon. As such, to prevent you from breaking things like replication, your users - even the root user you set up when you create the instance - will not have full superuser privileges:

create is assigned to the rds_superuser role. The rds_superuser role

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html

is a pre-defined Amazon RDS role similar to the PostgreSQL superuser

When you create a DB instance, the master user system account that you role (customarily named postgres in local instances), but with some create is assigned to the rds_superuser role. The rds_superuser role restrictions. As with the PostgreSQL superuser role, the rds_superuser is a pre-defined Amazon RDS role similar to the PostgreSQL superuser role has the most privileges on your DB instance and you should not role (customarily named postgres in local instances), but with some assign this role to users unless they need the most access to the DB restrictions. As with the PostgreSQL superuser role, the rds_superuser role has the most privileges on your DB instance and you should not instance.

assign this role to users unless they need the most access to the DB

In order to fix this error, just use -- to comment out the lines of SQL that contains COMMENT ON EXTENSION

instance.

EDIT 1: As suggested by Dmitrii I., you can also omit comments when dumping: pg_dump --no-comments