Re: Streaming base backups

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Magnus Hagander <magnus@hagander.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-01-07T21:31:49Z
Lists: pgsql-hackers

Attachments

On 05.01.2011 15:54, Magnus Hagander wrote:
> * Suggestion from Heikki: perhaps at some point we're going to need a full
>    bison grammar for walsender commands.

Here's a patch for this (Also available at 
git@github.com:hlinnaka/postgres.git, branch "streaming_base"). I 
thought I know our bison/flex magic pretty well by now, but it turned 
out to take much longer than I thought. But here it is.

I'm not 100% sure if this is worth the trouble quite yet. It adds quite 
a lot of boilerplate code.. OTOH, having a bison grammar file makes it 
easier to see what exactly the grammar is, and I like that. It's not too 
bad with three commands yet, but if it expands much further a bison 
grammar is a must.

At first I tried using the backend lexer for this, but it couldn't parse 
the xlog-start location in the "START_REPLICATION 0/47000000" command. 
In hindsight that may have been a badly chosen syntax. But as you 
pointed out on IM, the lexer needed to handle this limited set of 
commands is very small, so I wrote a dedicated flex lexer instead that 
can handle it.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com