[GENERAL] import_bytea function

2016-10-07 Thread Stephen Davies
I am trying to use the import_bytea function described in various list posts (PG version 9.3.14) in a jsp. I get an error saying that only the super user can use server-side lo_import(). If I change the Java connection to use user postgres, the function works but I would prefer not to do this.

Re: [GENERAL] import_bytea function

2016-10-07 Thread Thomas Kellerer
Stephen Davies schrieb am 07.10.2016 um 09:12: > I am trying to use the import_bytea function described in various list posts > (PG version 9.3.14) in a jsp. > > I get an error saying that only the super user can use server-side > lo_import(). > > If I change the Java connection to use user pos

Re: [GENERAL] import_bytea function

2016-10-07 Thread Stephen Davies
On 07/10/16 18:48, Thomas Kellerer wrote: Stephen Davies schrieb am 07.10.2016 um 09:12: I am trying to use the import_bytea function described in various list posts (PG version 9.3.14) in a jsp. I get an error saying that only the super user can use server-side lo_import(). If I change the J

Re: [GENERAL] import_bytea function

2016-10-07 Thread Thomas Kellerer
Stephen Davies schrieb am 07.10.2016 um 10:46: >> You can store the contents of a file in a bytea using plain JDBC no >> lo_import() required >> >> String sql = "insert into images (id, image_data) values (?,?)"; >> Connection con = ; >> File uploaded = new File("..."); >> Inpu

[GENERAL] pgpool question

2016-10-07 Thread Rakesh Kumar
I posted this in the pgpool mailing list and so far has not recvd any response. Looks like that mailing list is hardly active. = I am researching pgpool technology. Let us say we want to use it as an alternative to streaming replication of PG. Apparently

[GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread arnaud gaboury
I start an app which use a libpq function to read connection params in a URI. Until now, the app was using a tcp connection to connect to postgresql with this URI: postgres:// mmuser:mmuser_password@10.10.10.1:5432/mattermost?sslmode=disable&connect_timeout=10 I want to switch and make the app co

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread Andreas Kretschmer
arnaud gaboury wrote: > I start an app which use a libpq function to read connection params in a URI. > Until now, the app was using a tcp connection to connect to postgresql with > this URI: > > postgres://mmuser:mmuser_password@10.10.10.1:5432/mattermost?sslmode=disable& > connect_timeout=10 >

Re: [GENERAL] Lock contention in TransactionIdIsInProgress()

2016-10-07 Thread Merlin Moncure
On Wed, Oct 5, 2016 at 5:38 AM, Tomáš Uko wrote: > Hi Jeff, > > > > We have encountered same problem as you (in 9.5.4), it seems that so far it > hasn’t been ported back from 9.6, but if you take this commit and apply it > to 9.5 source codes, it seems to be working > > But anyway, does anybody kn

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread arnaud gaboury
On Fri, Oct 7, 2016 at 3:15 PM Andreas Kretschmer wrote: > arnaud gaboury wrote: > > > I start an app which use a libpq function to read connection params in a > URI. > > Until now, the app was using a tcp connection to connect to postgresql > with > > this URI: > > > > postgres:// > mmuser:mmus

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread Adrian Klaver
On 10/07/2016 06:42 AM, arnaud gaboury wrote: does that help? Honestly not so much, as it is a nearly perfect Copy/past of postgresql official doc[0]. My postgresql socket is in the usual place: /run/postgresql/.s.PGSQL.5432= So no need to specify it. But for the rest, I am still not

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread Adrian Klaver
On 10/07/2016 06:42 AM, arnaud gaboury wrote: > > > > Honestly not so much, as it is a nearly perfect Copy/past of postgresql > official doc[0]. > My postgresql socket is in the usual place: > /run/postgresql/.s.PGSQL.5432= > So no need to specify it. But for the rest, I am still not sure of m

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread arnaud gaboury
On Fri, Oct 7, 2016 at 3:56 PM Adrian Klaver wrote: > On 10/07/2016 06:42 AM, arnaud gaboury wrote: > > > > > > > > > Honestly not so much, as it is a nearly perfect Copy/past of postgresql > > official doc[0]. > > My postgresql socket is in the usual place: > > /run/postgresql/.s.PGSQL.5432= >

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread Adrian Klaver
On 10/07/2016 07:28 AM, arnaud gaboury wrote: On Fri, Oct 7, 2016 at 3:56 PM Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 10/07/2016 06:42 AM, arnaud gaboury wrote: > > > > Honestly not so much, as it is a nearly perfect Copy/past of postgresql > offi

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread arnaud gaboury
On Fri, Oct 7, 2016 at 4:42 PM Adrian Klaver wrote: On 10/07/2016 07:28 AM, arnaud gaboury wrote: > > > On Fri, Oct 7, 2016 at 3:56 PM Adrian Klaver > wrote: > > On 10/07/2016 06:42 AM, arnaud gaboury wrote: > > > > > > > > > Honestly not so

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread Adrian Klaver
On 10/07/2016 07:58 AM, arnaud gaboury wrote: GGGrrrh --- # systemctl restart postgresql # su mattermost bash-4.3$ psql postgresql://mmuser:XXX@/mattermost? psql (9.5.4) Type "help" for help. mattermost=> \q - O

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread Tom Lane
arnaud gaboury writes: > OK. Now I know unix user mattermost can connect to mattermost Db via unix > socket. BUT when trying to write this in my URI: > postgresql://mmuser:MyPwd@/mattermost?connect_timeout=10 > I get this from my app : > Failed to ping db err:pq: SSL is not enabled on the server

Re: [GENERAL] Libpq functions & string to obtain connection parameters

2016-10-07 Thread arnaud gaboury
On Fri, Oct 7, 2016 at 5:01 PM Adrian Klaver wrote: > On 10/07/2016 07:58 AM, arnaud gaboury wrote: > > > > > > > > > GGGrrrh > > > > --- > > # systemctl restart postgresql > > # su mattermost > > bash-4.3$ psql postgresql://mmuser:XXX@/mattermost? > > psql (9

[GENERAL] DBGlass - Open-sourced and cross-platform postgresql GUI client

2016-10-07 Thread Vladimir Pal
Hi folks! Jus released beta version of new open sourced and cross-platform postgresql GUI client. Check it out - https://github.com/web-pal/DBGlass --  Vladimir Pal

Re: [GENERAL] import_bytea function

2016-10-07 Thread Stephen Davies
On 07/10/16 19:24, Thomas Kellerer wrote: Stephen Davies schrieb am 07.10.2016 um 10:46: You can store the contents of a file in a bytea using plain JDBC no lo_import() required String sql = "insert into images (id, image_data) values (?,?)"; Connection con = ; File uploaded =

Re: [GENERAL] import_bytea function

2016-10-07 Thread Stephen Davies
On 07/10/16 19:24, Thomas Kellerer wrote: Stephen Davies schrieb am 07.10.2016 um 10:46: You can store the contents of a file in a bytea using plain JDBC no lo_import() required String sql = "insert into images (id, image_data) values (?,?)"; Connection con = ; File uploaded =

Re: [GENERAL] import_bytea function

2016-10-07 Thread Thomas Kellerer
Stephen Davies schrieb am 08.10.2016 um 02:57: A follow-up question. Once the bytea column is populated, how best to display the content in a web page? I have : byte [] imgB; ResultSet rs = st1.executeQuery("select pic from part where pno='" + p + "'"); if(rs.next()){ imgB = r