Page 1 of 1

Attach Database

Posted: Fri Feb 28, 2020 8:56 pm
by loulou2522
In sqlite you can attach à databse with this synthax

Code: Select all

ATTACH DATABASE 'toto'  As 'toto';
Can someone says me if it is possible in POSTGRESQL and eventually the sql synthax for
Thanks in advance

Re: Attach Database

Posted: Sat Feb 29, 2020 2:24 pm
by spikey
Yes, you can make external data connections but there is no ATTACH DATABASE in PostgreSQL; this is because PostgreSQL is a security concious, extensible, networked service and SQLite is self contained and doesn't really secure anything inherently.

Are you literally trying to connect to an SQLite database from a PostgreSQL server? Or do you actually mean something else? If so, what precisely? This will govern the direction to head in...

Re: Attach Database

Posted: Sun Mar 01, 2020 4:54 am
by percy_b
loulou2522 wrote:In sqlite you can attach à databse with this synthax

Code: Select all

ATTACH DATABASE 'toto'  As 'toto';
Can someone says me if it is possible in POSTGRESQL and eventually the sql synthax for
Thanks in advance
Hi Loulou2522,

PostgreSQL has a user-based system that revolves around schemas. Therefore, you can have a group of data that can exist under User1, User2, etc.

With this schema system you can then access these data-sources as User1.Table1, User1.Table2, User2.Table1,User2.Table2, User2.Table3,etc. All of these user/schemas exist in the same data file under PostgreSQL.

SQLite doesn't have this user/schema feature. Therefore, if you want to segregate data in SQLite, you have to use separate data files and employ the ATTACH statement.

However, it is possible to import external data into Postgres.

Sorry if I'm stating the obvious.

Sent from my LM-Q710.FG using Tapatalk