Re: [GENERAL] Grant SELECT/Execute to View/Function but not underlying Table

2015-09-24 Thread Maxim Boguk
On Thu, Sep 24, 2015 at 9:28 PM, Alex Magnum wrote: > Hi, > is it possible to grant select to views and functions without the need to > also grant the user the SELECT privileges to the Tables used in the views > or functions? > > That way I could create read only users on

Re: [GENERAL] Grant SELECT/Execute to View/Function but not underlying Table

2015-09-24 Thread David G. Johnston
On Thursday, September 24, 2015, Maxim Boguk wrote: > > > On Thu, Sep 24, 2015 at 9:28 PM, Alex Magnum > wrote: > >> Hi, >> is it possible to grant select to views and functions without the

Fwd: [GENERAL] Convert number to string

2015-09-24 Thread Francisco Olarte
Forgot replying to all, forwarding to the list, sorree for the potential dupes. Hi Hengky: On Thu, Sep 24, 2015 at 10:09 AM, Hengky Liwandouw wrote: > > I don’t have any idea how can I use postgres function to convert series of > number (currency) to my own string.

[GENERAL] Grant SELECT/Execute to View/Function but not underlying Table

2015-09-24 Thread Alex Magnum
Hi, is it possible to grant select to views and functions without the need to also grant the user the SELECT privileges to the Tables used in the views or functions? That way I could create read only users on a website and limit their access to the bare minimum. Thanks in advance for any advise

Re: [GENERAL] Grant SELECT/Execute to View/Function but not underlying Table

2015-09-24 Thread David G. Johnston
On Thursday, September 24, 2015, Alex Magnum wrote: > Hi, > is it possible to grant select to views and functions without the need to > also grant the user the SELECT privileges to the Tables used in the views > or functions? > > That way I could create read only users on

Re: [GENERAL] Grant SELECT/Execute to View/Function but not underlying Table

2015-09-24 Thread Thom Brown
On 24 September 2015 at 12:28, Alex Magnum wrote: > Hi, > is it possible to grant select to views and functions without the need to > also grant the user the SELECT privileges to the Tables used in the views or > functions? > > That way I could create read only users on a

[GENERAL] Use tar to online backup has an error

2015-09-24 Thread maxiangqian
Hi, when I use tar to online backup ,It has an error: /bin/tar: Removing leading `/' from member names /bin/tar: /data/test/PG_9.0_201008051/20001/2451: Cannot stat: No such file or directory /bin/tar: Error exit delayed from previous errors and

[GENERAL] Convert number to string

2015-09-24 Thread Hengky Liwandouw
Hi, I don't have any idea how can I use postgres function to convert series of number (currency) to my own string. My string : F G H I J K L M N as the replacement for number : 1 2 3 4 5 6 7 8 9 Dozens = O Hundreds = P Thousands = C Ten thousands = B So. 200 = GP 2000

Re: [GENERAL] Convert number to string

2015-09-24 Thread John R Pierce
On 9/24/2015 1:09 AM, Hengky Liwandouw wrote: Hi, I don’t have any idea how can I use postgres function to convert series of number (currency) to my own string. My string : F G H I J K L M N as the replacement for number : 1 2 3 4 5 6 7 8 9 Dozens = O Hundreds = P Thousands =

[GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Willy-Bas Loos
Hi, We're upgrading a database from 8.4 to 9.4 The web developer complains that the timestamps are suddenly 2 hours late. We are in GMT+02. The issue would go away if we cast the postgres timestamps to timestamp WITH timezone. It works in pg8.4 and 9.4 He told me that PHP always uses timezones,

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Willy-Bas Loos
On Thu, Sep 24, 2015 at 4:01 PM, Willy-Bas Loos wrote: > =# show timezone; > TimeZone > --- > localtime > (1 row) > > > sorry for the top post -- Willy-Bas Loos

Re: [GENERAL] Convert number to string

2015-09-24 Thread Francisco Olarte
HI Melvin: On Thu, Sep 24, 2015 at 2:51 PM, Melvin Davidson wrote: > Postgresql has a translate function: > ​Did you read the ( quoted at the bottom of the reply you sent ) message you were replying to? It contained a working sample using exactly this translate.​ ;-> > >

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Willy-Bas Loos
=# show timezone; TimeZone --- localtime (1 row) On Thu, Sep 24, 2015 at 3:57 PM, Adrian Klaver wrote: > On 09/24/2015 06:42 AM, Willy-Bas Loos wrote: > >> Hi, >> >> We're upgrading a database from 8.4 to 9.4 >> The web developer complains that the

Re: [GENERAL] Convert number to string

2015-09-24 Thread Melvin Davidson
Postgresql has a translate function: So you can create a pgsql function that A;: converts the numeric to text: txtnum := 12345::text B, Translate it. eg: transnum := SELECT translate(txtnum, '123456789', 'FGHIJKLMN'); eg SELECT translate('31241', '12345', 'FGHIJ'); = HFGIF You would then need

Re: [GENERAL] Use tar to online backup has an error

2015-09-24 Thread Yves Dorfsman
On 2015-09-24 03:55, maxiangqian wrote: > when I use tar to online backup ,It has an error: > > /bin/tar: Removing leading `/' from member names This is not an error, more like a warning. GNU tar doesn't not store the full path in the tar file, but a relative path, as full paths are

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Vik Fearing
On 09/24/2015 03:42 PM, Willy-Bas Loos wrote: > Hi, > > We're upgrading a database from 8.4 to 9.4 > The web developer complains that the timestamps are suddenly 2 hours late. > We are in GMT+02. > The issue would go away if we cast the postgres timestamps to timestamp > WITH timezone. It works

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Adrian Klaver
On 09/24/2015 06:42 AM, Willy-Bas Loos wrote: Hi, We're upgrading a database from 8.4 to 9.4 The web developer complains that the timestamps are suddenly 2 hours late. We are in GMT+02. The issue would go away if we cast the postgres timestamps to timestamp WITH timezone. It works in pg8.4 and

Re: [GENERAL] Use tar to online backup has an error

2015-09-24 Thread David Steele
On 9/24/15 9:29 AM, Yves Dorfsman wrote: On 2015-09-24 03:55, maxiangqian wrote: /bin/tar: /data/test/PG_9.0_201008051/20001/2451: Cannot stat: No such file or directory /bin/tar: Error exit delayed from previous errors and /data/test/PG_9.0_201008051/20001/2451 file is not exist.

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Tom Lane
Adrian Klaver writes: > On 09/24/2015 07:01 AM, Willy-Bas Loos wrote: >> =# show timezone; >> TimeZone >> --- >> localtime >> (1 row) > This sounded familiar: > http://www.postgresql.org/message-id/m3616t3m5d@carbon.jhcloos.org Yeah ... we never did figure

Re: [GENERAL] Use tar to online backup has an error

2015-09-24 Thread Stephen Frost
* David Steele (da...@pgmasters.net) wrote: > It's actually perfectly normal for files to disappear during a > backup, even when pg_start_backup() is called first (never perform > file-level backup with calling pg_start_backup()). The database *without* calling pg_start_backup, you mean. :) >

Re: [GENERAL] Use tar to online backup has an error

2015-09-24 Thread David Steele
On 9/24/15 10:15 AM, Stephen Frost wrote: * David Steele (da...@pgmasters.net) wrote: It's actually perfectly normal for files to disappear during a backup, even when pg_start_backup() is called first (never perform file-level backup with calling pg_start_backup()). The database *without*

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Tom Lane
Willy-Bas Loos writes: > Is there a reason for this change of behavior between 8.4 and 9.* ? See the "incompatibilities" section in the 9.2 release notes: * Make EXTRACT(EPOCH FROM timestamp without time zone) measure the epoch from local midnight, not UTC

Re: [GENERAL] Automatically Updatable Foreign Key Views

2015-09-24 Thread Tom Lane
David Rowley writes: > On 24 September 2015 at 13:32, Raymond Brinzer > wrote: >> Any thoughts on this would be welcome. > The problem is that an UPDATE/DELETE could take place which causes the > foreign key to be violated and you may try and

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Adrian Klaver
On 09/24/2015 07:01 AM, Willy-Bas Loos wrote: =# show timezone; TimeZone --- localtime (1 row) Is this the same on both 8.4 and 9.4? Are both servers on the same machine? What does /etc/localtime point to? On Thu, Sep 24, 2015 at 3:57 PM, Adrian Klaver

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Adrian Klaver
On 09/24/2015 07:01 AM, Willy-Bas Loos wrote: =# show timezone; TimeZone --- localtime (1 row) This sounded familiar: http://www.postgresql.org/message-id/m3616t3m5d@carbon.jhcloos.org From there, per Tom Lane: select * from pg_settings where name = 'TimeZone'; This will

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Adrian Klaver
On 09/24/2015 08:08 AM, Tom Lane wrote: Adrian Klaver writes: On 09/24/2015 07:01 AM, Willy-Bas Loos wrote: =# show timezone; TimeZone --- localtime (1 row) This sounded familiar: http://www.postgresql.org/message-id/m3616t3m5d@carbon.jhcloos.org

Re: [GENERAL] epoch and timezone changed bevior

2015-09-24 Thread Willy-Bas Loos
On Thu, Sep 24, 2015 at 5:22 PM, Adrian Klaver wrote: > Yeah, I forgot about the EXTRACT change. > > >> regards, tom lane >> >> > thanks a lot for clarifying! -- Willy-Bas Loos

[GENERAL] [Q] Serializable

2015-09-24 Thread Ladislav Lenart
Hello. I would like to know how SERIALIZABLE behaves. Suppose I have two (or more) concurrent DB transactions: * Each runs in SERIALIZABLE. * Each updates (insert / update / delete) different rows in the same table. Can I get serializable failures (i.e. ERROR: could not serialize access due to

Re: [GENERAL] [Q] Serializable

2015-09-24 Thread David G. Johnston
On Thu, Sep 24, 2015 at 12:15 PM, Ladislav Lenart wrote: > Hello. > > I would like to know how SERIALIZABLE behaves. > > Suppose I have two (or more) concurrent DB transactions: > * Each runs in SERIALIZABLE. > * Each updates (insert / update / delete) different rows in the

Re: [GENERAL] Dropped connections with pg_basebackup

2015-09-24 Thread Sherrylyn Branchaw
I'm assuming based on the "SSL error" that you have ssl set to 'on'. What's your ssl_renegotiation_limit? The default is 512MB, but setting it to 0 has solved problems for a number of people on this list, including myself. Sherrylyn On Thu, Sep 24, 2015 at 3:57 PM, Francisco Reyes

Re: [GENERAL] Dropped connections with pg_basebackup

2015-09-24 Thread Adrian Klaver
On 09/24/2015 12:57 PM, Francisco Reyes wrote: Have an existing setup of 9.3 servers. Replication has been rock solid, but recently the circuits between data centers were upgraded and pg_basebackup now seems to fail often when setting up streaming replication. What used to take 10+ hours now

Re: [GENERAL] Dropped connections with pg_basebackup

2015-09-24 Thread Sherrylyn Branchaw
Ah, yes, it's been removed from 9.5: http://www.postgresql.org/docs/9.5/static/release-9-5.html Good to know. On Thu, Sep 24, 2015 at 4:34 PM, Alvaro Herrera wrote: > Sherrylyn Branchaw wrote: > > I'm assuming based on the "SSL error" that you have ssl set to 'on'. >

Re: [GENERAL] Use tar to online backup has an error

2015-09-24 Thread maxiangqian
Hi I got it. Thanks for your kindly support!!! Thank you very much. 2015-09-24 22:18 GMT+08:00 David Steele : > On 9/24/15 10:15 AM, Stephen Frost wrote: > >> * David Steele (da...@pgmasters.net) wrote: >> >>> It's actually perfectly normal for files to disappear during

[GENERAL] Dropped connections with pg_basebackup

2015-09-24 Thread Francisco Reyes
Have an existing setup of 9.3 servers. Replication has been rock solid, but recently the circuits between data centers were upgraded and pg_basebackup now seems to fail often when setting up streaming replication. What used to take 10+ hours now only took 68 minutes, but had to do many

Re: [GENERAL] Dropped connections with pg_basebackup

2015-09-24 Thread Alvaro Herrera
Sherrylyn Branchaw wrote: > I'm assuming based on the "SSL error" that you have ssl set to 'on'. What's > your ssl_renegotiation_limit? The default is 512MB, but setting it to 0 has > solved problems for a number of people on this list, including myself. Moreover, the default has been set to 0,