Re: [GENERAL] How safe is pg_basebackup + continuous archiving?

2016-06-29 Thread Michael Paquier
On Wed, Jun 29, 2016 at 11:51 PM, Kaixi Luo wrote: > We use PostgreSQL at work and we do daily backups with pg_dump. After that > we pg_restore the dump and check the database that there isn't any data > corruption. As the database grows, the whole pg_dump / pg_restore cycle

Re: [GENERAL] Stored procedure version control

2016-06-29 Thread Neil Anderson
On 2016-06-29 12:37 PM, Mark Morgan Lloyd wrote: Elsewhere, somebody was asking how people implemented version control for stored procedures on (MS) SQL Server. The consensus was that this is probably best managed by using scripts or command files to generate stored procedures etc., but does

Re: [GENERAL] Stored procedure version control

2016-06-29 Thread Neil Anderson
On 2016-06-29 12:37 PM, Mark Morgan Lloyd wrote: Elsewhere, somebody was asking how people implemented version control for stored procedures on (MS) SQL Server. The consensus was that this is probably best managed by using scripts or command files to generate stored procedures etc., but does

Re: [GENERAL] Stored procedure version control

2016-06-29 Thread Peter Devoy
>does anybody have any comment on that from the POV of PostgreSQL? Might be overkill but you could deploy your procedure as an extension because extensions come with version control: https://www.postgresql.org/docs/current/static/sql-createextension.html Another option might be to hack something

Re: [GENERAL] Stored procedure version control

2016-06-29 Thread Scott Marlowe
On Wed, Jun 29, 2016 at 12:00 PM, Adrian Klaver wrote: > On 06/29/2016 09:37 AM, Mark Morgan Lloyd wrote: >> >> Elsewhere, somebody was asking how people implemented version control >> for stored procedures on (MS) SQL Server. >> >> The consensus was that this is

Re: [GENERAL] Stored procedure version control

2016-06-29 Thread Adrian Klaver
On 06/29/2016 09:37 AM, Mark Morgan Lloyd wrote: Elsewhere, somebody was asking how people implemented version control for stored procedures on (MS) SQL Server. The consensus was that this is probably best managed by using scripts or command files to generate stored procedures etc., but does

[GENERAL] Stored procedure version control

2016-06-29 Thread Mark Morgan Lloyd
Elsewhere, somebody was asking how people implemented version control for stored procedures on (MS) SQL Server. The consensus was that this is probably best managed by using scripts or command files to generate stored procedures etc., but does anybody have any comment on that from the POV of

Re: [GENERAL] cache lookup failed for index

2016-06-29 Thread Willy-Bas Loos
On Wed, Jun 29, 2016 at 4:26 PM, Tom Lane wrote: > Willy-Bas Loos writes: > > So what i don't get is, -if the above is the case- If pg_dump expects to > > find an index, it already knows about its existence. Then why does it > need > > to look for it

[GENERAL] How safe is pg_basebackup + continuous archiving?

2016-06-29 Thread Kaixi Luo
Hello, We use PostgreSQL at work and we do daily backups with pg_dump. After that we pg_restore the dump and check the database that there isn't any data corruption. As the database grows, the whole pg_dump / pg_restore cycle time is quickly approaching 24h, so we need to change strategies.

Re: [GENERAL] cache lookup failed for index

2016-06-29 Thread Tom Lane
Willy-Bas Loos writes: > So what i don't get is, -if the above is the case- If pg_dump expects to > find an index, it already knows about its existence. Then why does it need > to look for it again? Because what it does is: BEGIN ISOLATION LEVEL REPEATABLE READ; -- run in

Re: [GENERAL] Enquiry

2016-06-29 Thread Melvin Davidson
Almost all databases are "scalable". The scalability is based on schema design and hardware architecture. As long as you are careful about table structures and relationships and have sufficient hardware, it should scale nicely. What does "scalable database" mean?

Re: [GENERAL] Enquiry

2016-06-29 Thread Adrian Klaver
On 06/29/2016 12:36 AM, mohd abdul azeem wrote: Hello This is Mohammed. I am a database developer using postgres as the backend database. i am working on the postgres version 9.3.5 for development purpose. Any particular reason you are using this version instead of the most recent, 9.5.3 or

Re: [GENERAL] Enquiry

2016-06-29 Thread Andreas Joseph Krogh
På onsdag 29. juni 2016 kl. 09:36:12, skrev mohd abdul azeem < mohdabdulaz...@hotmail.com >: Hello   This is Mohammed. I am a database developer using postgres as the backend database. i am working on the postgres version 9.3.5 for development purpose.   I have

[GENERAL] Enquiry

2016-06-29 Thread mohd abdul azeem
Hello This is Mohammed. I am a database developer using postgres as the backend database. i am working on the postgres version 9.3.5 for development purpose. I have just signed up with the postgres community. i hope this is correct place for getting my queries answered. I am planning to learn

Re: [GENERAL] Sub-query having NULL row returning FALSE result

2016-06-29 Thread David G. Johnston
On Wed, Jun 29, 2016 at 2:07 AM, Sridhar N Bamandlapally < sridhar@gmail.com> wrote: > Hi > > Please go through below case > > postgres=# CREATE TABLE emp (id INTEGER unique, ename VARCHAR); > CREATE TABLE > postgres=# INSERT INTO emp VALUES (null, 'aaa'); > INSERT 0 1 > postgres=# INSERT

Re: [GENERAL] cache lookup failed for index

2016-06-29 Thread Willy-Bas Loos
On Wed, Jun 29, 2016 at 11:16 AM, Willy-Bas Loos wrote: > Ah OK. So it needs a lock for the visibility to be registered to the > transaction, is that it? > Wait that doesn't make sense. pg_dump merely describes the table in DDL, so it doesn't even need access to the index

Re: [GENERAL] cache lookup failed for index

2016-06-29 Thread Willy-Bas Loos
Ah OK. So it needs a lock for the visibility to be registered to the transaction, is that it?

Re: [GENERAL] Sub-query having NULL row returning FALSE result

2016-06-29 Thread Sridhar N Bamandlapally
Hi The actual statement is MERGE INTO NOT MATCHED, which in PG migrated to WITH - INSERT however, yes, the SQL-statement in previous does not work in other databases too, I was wrong Thanks, thanks again Sridhar OpenText On Wed, Jun 29, 2016 at 11:58 AM, Tom Lane wrote:

Re: [GENERAL] Sub-query having NULL row returning FALSE result

2016-06-29 Thread Tom Lane
Sridhar N Bamandlapally writes: > postgres=# CREATE TABLE emp (id INTEGER unique, ename VARCHAR); > postgres=# INSERT INTO emp VALUES (null, 'aaa'); > ... > postgres=# INSERT INTO emp SELECT * FROM (SELECT 5::integer id, > 'eee'::varchar ename) nr WHERE id NOT IN (SELECT id

[GENERAL] Sub-query having NULL row returning FALSE result

2016-06-29 Thread Sridhar N Bamandlapally
Hi Please go through below case postgres=# CREATE TABLE emp (id INTEGER unique, ename VARCHAR); CREATE TABLE postgres=# INSERT INTO emp VALUES (null, 'aaa'); INSERT 0 1 postgres=# INSERT INTO emp VALUES (null, 'bbb'); INSERT 0 1 postgres=# INSERT INTO emp VALUES (3, 'ccc'); INSERT 0 1 postgres=#