------------------------------------ * pg_file_write - old version * * The superuser() check here must be kept as the library might be upgraded * without the extension being upgraded, meaning that in pre-1.1 installations * these functions could be called by any user. */
| 131 | * these functions could be called by any user. |
| 132 | */ |
| 133 | Datum |
| 134 | pg_file_write(PG_FUNCTION_ARGS) |
| 135 | { |
| 136 | text *file = PG_GETARG_TEXT_PP(0); |
| 137 | text *data = PG_GETARG_TEXT_PP(1); |
| 138 | bool replace = PG_GETARG_BOOL(2); |
| 139 | int64 count = 0; |
| 140 | |
| 141 | requireSuperuser(); |
| 142 | |
| 143 | count = pg_file_write_internal(file, data, replace); |
| 144 | |
| 145 | PG_RETURN_INT64(count); |
| 146 | } |
| 147 | |
| 148 | /* ------------------------------------ |
| 149 | * pg_file_write_v1_1 - Version 1.1 |
nothing calls this directly
no test coverage detected