Argh I'm sorry: you meant the "sa" user for the database management system, 
not the "administrator" of the windows OS (what I understood).

But to my honest opinion, there are many use cases where this bug (csvread 
working without requiring to be "sa" dbms user) is actually a good 
thing/feature.

csvread could be for example used to grab external data and write into an 
existing table where you're granted insert access. I do not understand why 
this should be forbidden.

On csvwrite: if you are granted select access on a table, I do not see why 
we should forbid writing data out. Any ETL tool supporting H2 will output 
CSV OOTB. Why should we use an ETL for this instead of pure H2 console 
scripts?

On Wednesday, January 4, 2017 at 12:27:34 PM UTC+1, Chris Sunderland wrote:
>
> Actually the CSVWRITE is correct here since I'm trying to execute this 
> function as a non-admin user.  The documentation says that this function as 
> well as CSVREAD require admin capabilities to execute.
>
> But when I try to execute CSVREAD as a non-admin H2 user, the function 
> succeeds when per the documentation it should fail.
>
>
> On Wednesday, January 4, 2017 at 2:08:57 AM UTC-6, Christian MICHON wrote:
>>
>> Who created the folder c:\temp ?
>>
>> If it was not created by your standard user account, you may have no 
>> rights to write into it. Please check the r/w rights access to it, even a 
>> simple file copy into it will give you a clue.
>>
>> For me this works as I created the folder c:\temp myself with a standard 
>> user account. I tried with version 1.3.176
>>
>> On Tuesday, January 3, 2017 at 9:59:42 PM UTC+1, Chris Sunderland wrote:
>>>
>>> It doesn't appear that CSVREAD is requiring admin rights per the 
>>> documentation.  However CSVWRITE properly throws an error if I try to 
>>> execute this as a standard user:
>>>
>>> Exception in thread "main" org.h2.jdbc.JdbcSQLException: Admin rights 
>>> are required for this operation; SQL statement:
>>> CALL *CSVWRITE*('c:/temp/test.csv', 'SELECT * FROM TableA'); [90040-176]
>>> at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
>>> at org.h2.message.DbException.get(DbException.java:178)
>>>
>>> I am using H2 version 1.3.176.
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to