Hello everybody, i'm new using zeos and need to import from a postgre8 database it's schema, of course from the code, from command line its so easy!
So I would like to ask if anyone knows how to make a copy of a table including its constraints, not its data. I'm using delphi 10.
I've seen the method gettables from TZPostgreSQLDatabaseMetadata and so, but how to get for example the text of a check clause?
Thank you so much!
How to copy a table's schema
Moderators: gto, cipto_kh, EgonHugeist
Hello mdaems, in postgres you can do pg_dump -s <databasename> to get a sql script that creates the schema.
The problem is that I have to connect to a remote database, throw the command and get the result somehow. I don't know how to convert the output to a stream or resultset, it seems complicated, on the other hand is the fastest.
I'm thinking in a stored procedure that returns me a tstring with the script..
Thank you for your help
The problem is that I have to connect to a remote database, throw the command and get the result somehow. I don't know how to convert the output to a stream or resultset, it seems complicated, on the other hand is the fastest.
I'm thinking in a stored procedure that returns me a tstring with the script..
Thank you for your help
Hello, using pg_dump works fine on win32 using a pipe to get the output, the problem is that my client is on windows and the remote server is on linux.
I can only think in connecting trough a socket to run the command, I haven't found if zeos can call anything which is not a sql command ¿maybe using a stored procedure?
Any idea is greatly appreciated
Thanks
I can only think in connecting trough a socket to run the command, I haven't found if zeos can call anything which is not a sql command ¿maybe using a stored procedure?
Any idea is greatly appreciated
Thanks