基本上我想从Postgres中的SQL文件执行SQL文件。可以从SQL脚本中引用另一个SQL文件
为MySQL类似的问题:is it possible to call a sql script from a stored procedure in another sql script?
为什么?
因为我有一个项目中有2个数据文件,我想要一行可以加载第二个文件的注释/未注释。
澄清: 我想从A.SQL调用B.SQL
Clarification2: 这对于那些使用Hibernate创建从最初的SQL文件数据库中的Spring项目(A. SQL)。
进一步反思,似乎我可能不得不从java /字符串/休眠处理这个。
下面是配置文件:在SQL不支持
spring.datasource.url=jdbc:postgresql://localhost:5432/dbname
spring.datasource.username=postgres
spring.datasource.password=root
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.data=classpath:db/migration/postgres/data.sql
spring.jpa.hibernate.ddl-auto=create
你怎么想执行的SQL文件?用psql? –
@Tommaso Di Bucchianico我想从另一个文件调用一个sql文件。 –