Re: [GENERAL] Better way to process boolean query result in shell-like situations?

2015-10-29 Thread David
On 10/28/2015 09:42 PM, Tim Landscheidt wrote: Hi, I regularly run into the problem that I want to query a PostgreSQL database in a script/program and depending on a boolean result do one thing or the other. A typical example would be a Puppet Exec that creates a user only if it does not exist

Re: [GENERAL] Better way to process boolean query result in shell-like situations?

2015-10-29 Thread David
On 10/29/2015 08:27 AM, Adrian Klaver wrote: On 10/29/2015 06:07 AM, David wrote: On 10/28/2015 09:42 PM, Tim Landscheidt wrote: Hi, I regularly run into the problem that I want to query a PostgreSQL database in a script/program and depending on a boolean result do one thing or the other. A

[GENERAL] Looking for pure C function APIs for server extension: language handler and SPI

2016-02-29 Thread david
know what it might look like. FYI apart from these two APIs (and their 4x5 conversions), the only other thing needed is some SQL code generation and I expect to have a working language of considerable power. Any help, suggestions, pointers much appreciated. Regards David M Bennett FACS

Re: [GENERAL] Looking for pure C function APIs for server extension: language handler and SPI

2016-03-02 Thread david
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of John McKown Sent: Wednesday, 2 March 2016 1:03 PM To: da...@andl.org Cc: pgsql-general-owner+M220260=david=andl@postgresql.org; Postgres General Subject: Re: [GENERAL] Looking for pure C

[GENERAL] CStringGetTextDatum and other conversions in server-side code

2016-03-02 Thread david
. Is there any particular documentation I can read? Regards David M Bennett FACS _ Andl - A New Database Language - andl.org

Re: [GENERAL] CStringGetTextDatum and other conversions in server-side code

2016-03-02 Thread david
e source code itself. Look at examples, see what they do, emulate it. [dmb>] That was my plan. But I do prefer to emulate code that is 'right'. [dmb>] So how would I go about finding a set of useful conversion functions for basic types (real, decimal, time, etc)? Regards David M Ben

Re: [GENERAL] CStringGetTextDatum and other conversions in server-side code

2016-03-02 Thread david
is particularly a problem for all the variable length types (eg text, time and decimal). Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.

Re: [GENERAL] CStringGetTextDatum and other conversions in server-side code

2016-03-03 Thread david
s as the go between, so I don't have to write too much C code. Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] CStringGetTextDatum and other conversions in server-side code

2016-03-03 Thread david
I queries, decoding tuples, etc. It's just these conversions that have me stuck. Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Does a call to a language handler provide a context/session, and somewhere to keep session data?

2016-03-06 Thread david
store data (a cache?) that has been retrieved from the database for use by concurrent sessions using that database? Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Does a call to a language handler provide a context/session, and somewhere to keep session data?

2016-03-07 Thread david
? I’m not finding that easy to understand by reading source code. Regards David M Bennett FACS _ MD Powerflex Corporation, creators of PFXplus To contact us, please call +61-3-9548-9114 or go to <http://www.pfxcorp.com/contact.htm> www.pfxcorp.com/contact.htm From: pgsql-g

Re: [GENERAL] Does a call to a language handler provide a context/session, and somewhere to keep session data?

2016-03-07 Thread david
as a GUID or timestamp or counter) would seem to serve the purpose. I just wondered if there was something clever I hadn’t found out about yet. Regards David M Bennett FACS _ Andl - A New Database Language - andl.org

Re: [GENERAL] Does a call to a language handler provide a context/session, and somewhere to keep session data?

2016-03-07 Thread david
ing (after naming things)? [dmb>] Seems like DLL static memory with allocation from process memory (or even malloc()) is "the simplest thing that could possibly work". Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing li

Re: [GENERAL] Does a call to a language handler provide a context/session, and somewhere to keep session data?

2016-03-07 Thread david
#x27;/usr/lib/jvm/java-1.8.0/lib/libjvm.so' or whatever which it uses to find the Java native calls interface library... [dmb>] Andl has something similar, but that problem is already solved. Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql

Re: [GENERAL] Does a call to a language handler provide a context/session, and somewhere to keep session data?

2016-03-07 Thread david
be queries, but that doesn't look too hard. SPI is quite well documented. Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Does a call to a language handler provide a context/session, and somewhere to keep session data?

2016-03-08 Thread david
some parameters. [dmb>] The website always lags behind. I only started with Postgres about 2 weeks ago, and I really am only now getting a clear enough idea to be able to write coherently about it. Depending on where that goes, you should get pgsql-hackers involved. [dmb>] Love to. It

Re: [GENERAL] Does a call to a language handler provide a context/session, and somewhere to keep session data?

2016-03-08 Thread david
can be changed? I use Outlook, and while it has lots of options, I can only pick one. I've now switched to what seems to work best for plain text mailing lists, but it looks terrible on anything else. Very annoying. Regards David M Bennett FACS Andl - A New Database Language - andl.org

Re: Email address VERP problems (was RE: [GENERAL] Does a call to a language handler provide a context/session, and somewhere to keep session data?

2016-03-09 Thread david
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Magnus Hagander Sent: Thursday, 10 March 2016 6:18 AM To: Alvaro Herrera Cc: David Bennett ; pgsql-general@postgresql.org Subject: Re: Email address VERP problems (was RE: [GENERAL] Does a call to a

[GENERAL] How to find configuration data in _PG_init()

2016-03-10 Thread david
used to load the DLL? I couldn’t find one in the existing language implementations. Having got started it then needs to query the database. Is that OK in _PG_init()? Any hints much appreciated. Regards David M Bennett FACS _ Andl - A New Database Language - andl.org

Re: [GENERAL] How to find configuration data in _PG_init()

2016-03-10 Thread david
-pg-proc.html Yes, I'm familiar with all those. One possibility is to retrieve pg_proc.probin, which appears to always contain the relevant path. > > > > > Having got started it then needs to query the database. Is that OK > in > > _PG_init()? Regards David M B

[GENERAL] How to detoast a column of type BYTEAOID

2016-04-17 Thread david
uld I do (in general) to ensure the values I retrieve are de-toasted? Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] How do BEGIN/COMMIT/ABORT operate in a nested SPI query?

2016-04-18 Thread david
do or do not contain BEGIN/ABORT/COMMIT? Do they nest, or does an inner COMMIT finish a transaction started by an outer BEGIN, or is it ignored? Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] How to detoast a column of type BYTEAOID

2016-04-18 Thread david
OK, got it. I really wasn't expecting to have to deal with TOASTs in what looks like a rather ordinary query -- perhaps there might be a note in the documentation? But thanks, that works just fine. Problem solved. Regards David M Bennett FACS Andl - A New Database Language - and

Re: [GENERAL] How do BEGIN/COMMIT/ABORT operate in a nested SPI query?

2016-04-18 Thread david
andler, since every call to a language handler is a call to a function. Did you mean 'inside a nested function'? Or something else? Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] How do BEGIN/COMMIT/ABORT operate in a nested SPI query?

2016-04-20 Thread david
x27;, ati:=t'2016-12-31 23:59:58.' }} V6 $$); And the generated code (which executes without error): BEGIN; DROP TABLE IF EXISTS "V6" ; CREATE TABLE "V6" ( "abo" BOOLEAN, "abi" BYTEA, "anu" NUMERIC, "ate" TEXT, "ati" T

Re: [GENERAL] How do BEGIN/COMMIT/ABORT operate in a nested SPI query?

2016-04-20 Thread david
", "ati" FROM > > "V6"; > > Define "executes". You could shove those lines in via the wire protocol, > sure, but SPI won't take them. Now you really have me puzzled. What I provided is an extract from the log of generated SQL commands sent

Re: [GENERAL] How do BEGIN/COMMIT/ABORT operate in a nested SPI query?

2016-04-20 Thread david
checked and any unexpected error is trapped, resulting eventually in a call to elog(ERROR). The sequence I provided is a CREATE TABLE followed by an INSERT. The table is successfully created with the correct contents. Regards David M Bennett FACS Andl - A New Database Language - andl.org

[GENERAL] Is it possible to call Postgres directly?

2016-04-20 Thread david
trying to do is provide a substitute for existing wire protocols, using either a Thrift server or a Web server calling directly into Postgres. Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] Is it possible to call Postgres directly?

2016-04-20 Thread david
I really don't want or need to go lower than that. So the question is: Can a C program link to the Postgres DLL and call SPI directly, rather than through a language function? Is there a way to launch a Thrift server or a Web server and call SPI directly? Regards David M Bennett FACS Andl -

Re: [GENERAL] Is it possible to call Postgres directly?

2016-04-21 Thread david
lready did an Sqlite implementation. It was the obvious place to start, but now I need a real server. Regards David M Bennett FACS Andl - A New Database Language - andl.org > -Original Message- > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Thursday, 21 April 201

Re: [GENERAL] Proper relational database?

2016-04-22 Thread david
me code samples. Regards David M Bennett FACS Andl - A New Database Language - andl.org > -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Paul Jungwirth > Sent: Saturday, 23 April 2016 5:38 AM > To

Re: [GENERAL] Proper relational database?

2016-04-22 Thread david
mean by that? Regards David M Bennett FACS _ Andl - A New Database Language - andl.org From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Guyren Howe Sent: Saturday, 23 April 2016 5:54 AM To: PostgreSQL General Subject: Re

Re: [GENERAL] Proper relational database?

2016-04-22 Thread david
o SQL? I'm not > aware that there are, but I'd be interested to hear of it. If there were, > there's a good chance you wouldn't be able to translate them into the parse > tree, either. Absolutely not. SQL is a (nearly) full implementation of the relational algebra, plus

Re: [GENERAL] Proper relational database?

2016-04-22 Thread david
of SQL are aware of situations where they are useful. In Andl they are automatically available as literals. Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Proper relational database?

2016-04-22 Thread david
much doubt it. The use case has to be established first. As it happens, the existing PL extension capability provides enough to get an alternative query language (such as Andl) to work. That's why I chose Postgres. Making it a 'native' would be not so hard if there is real deman

Re: [GENERAL] Proper relational database?

2016-04-23 Thread david
things. It also might be > implemented in such a way that it can run as a server or more like SQLite. Andl does that. It provides 3 native servers: Thrift, Web API and REST. Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-ge

Re: [GENERAL] Proper relational database?

2016-04-23 Thread david
> This is a relevant project: https://github.com/agentm/project-m36 Thanks -- I didn't know about that one. I'll add it to my list. It's quite unlike other implementations. I have some reading to do. Regards David M Bennett FACS Andl - A New Database Language - andl.org

Re: [GENERAL] Proper relational database?

2016-04-23 Thread david
an verify it works right. It's not that important -- Andl can emulate it quite easily. Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Proper relational database?

2016-04-23 Thread david
just fine. Regards David M Bennett FACS _ Andl - A New Database Language - andl.org

Re: [GENERAL] Proper relational database?

2016-04-23 Thread david
useful non-relational features, but yes. Friendly relational is what I'm working on. Regards David M Bennett FACS _ Andl - A New Database Language - andl.org

Re: [GENERAL] Proper relational database?

2016-04-23 Thread david
ed into that effort. See http://www.thethirdmanifesto.com/. Hugh worked for some years for IBM on the SQL Committee, but eventually left over a major disagreement in direction. TTM is based on the work he's done since (with Chris Date). Andl derives from that. I would say that very little

Re: [GENERAL] Proper relational database?

2016-04-23 Thread david
are dumb. Then the first credit card number gets lost in an > eventually-consistent system, and people suddenly understand viscerally why > transactions semantics are so hard. But there is goodness there, and NoSQL is now just as hard to replace. Regards David M Bennett FACS Andl - A New

Re: On the right tool (was Re: [GENERAL] Proper relational database?)

2016-04-23 Thread david
But in the software > world, we must be more mindful than ever that we understand our tools -- the > shapes that they take and that they make. > Historicism in software is no vice. It is the path by which we learn to make > new mistakes, as opposed to the same mistake over again. Mos

Re: [GENERAL] Proper relational database?

2016-04-24 Thread david
; > (erm, OK, I guess you can use an empty select list in recent Postgres). SQL has an implicit ordering of query evaluation -- you will often need to write a nested subquery or correlated query for what should be very straightforward situations. That's another thing that's easy to fix, if

[GENERAL] Background worker plus language handler for Andl: OK?

2016-04-24 Thread david
? There is a fair bit of work, and it would be nice to know what to watch out for. Regards David M Bennett FACS Andl - A New Database Language - andl.org -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [GENERAL] Background worker plus language handler for Andl: OK?

2016-04-25 Thread david
> ow...@postgresql.org] On Behalf Of David Wilson > I've been reading your posts over the past few days and while I find it fun > to follow, I can't help but wonder why there there is urgency in > reimplementing a protocol within PG itself. I think it's an interesting

[GENERAL] Problems running the WorkerSpi sample

2016-04-25 Thread david
false. So this appears to be an extension that must be preloaded. That does >not seem to be documented anywhere. It would be helpful to get some suggestions about what changes would be needed to allow it to be loaded on demand. Regards David M Bennett FACS _ Andl - A New Database Language - andl.org

Re: [GENERAL] Problems running the WorkerSpi sample

2016-04-26 Thread david
t would be helpful to add this to the documentation. From this point on, it looks pretty straightforward, but getting here was not easy. I’m still wondering how to do a clean restart of the server without pg_ctl. Restarting the service is a bit brutal. Regards David M Bennett FACS _ An

Re: [GENERAL] intermittent issue with windows 7 service manager not able to correctly determine or control postgresql 9.4

2016-04-30 Thread david
I have the same problem routinely on Windows 10. The postgresql-x64-9.5 service shows up in Task Manager as Stopped, but is actually running just fine. BTW pg_ctl does nothing – silently. The only way to restart the server is to kill off a process or two. Regards David M Bennett

Re: [GENERAL] pgpool II question

2007-09-12 Thread David
On 9/12/07, sharmi Joe <[EMAIL PROTECTED]> wrote: > Hi, > Im a newbie to postgres. Can you explain what pgpool is ? > Thanks > > http://pgpool.projects.postgresql.org/ ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an

[GENERAL] General Q's

2007-12-12 Thread David
am a 3-year old! * What other Open Source solutions which support the similar type of functionality found on Joomla and Drupal work with Postgresql? David Brown Eclipse Consulting M (UK) +447939544481 F (UK) +44207193259

[GENERAL] Insert Rewrite rules

2008-04-20 Thread David
I am currently attempting to migrate one of our customers databases to partitioned tables. This database is used to store firewall logs and is currently in the range of 600GB (thats 90 days worth). I am having problems with the rewrite rules though it seems to be skipping over any rule that has

Re: [GENERAL] Insert Rewrite rules

2008-04-21 Thread David
have modified my data loader to do the same to get the 600G of data back in in partitioned tables. And as far as I know it was a row level trigger but I could be wrong On Mon, Apr 21, 2008 at 05:32:29PM +1000, Klint Gore wrote: > David wrote: > >I am having problems with the rewrite rul

[GENERAL] Database design questions

2008-06-18 Thread David
ld have helped with the above? (it would have required a *lot* of user help). Are there recommended ways of designing tables so that synchronization is easier? The main thing I've read about is ensuring that all records have a natural key of some kind, eg GUID. Also, your migration app needs to h

Re: [GENERAL] Controlling write access to a table

2008-06-18 Thread David
roles in newer postgresql versions), and only granting update permissions to the users/groups who should have it? David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Controlling write access to a table

2008-06-18 Thread David
Hi Dave. Did you intentionally mail me off-list? On-list is generally better so other people can give suggestions. On Wed, Jun 18, 2008 at 12:04 PM, Dave Coventry <[EMAIL PROTECTED]> wrote: > On Wed, Jun 18, 2008 at 11:33 AM, David <[EMAIL PROTECTED]> wrote: >> How abou

Re: [GENERAL] Database design questions

2008-06-18 Thread David
On Wed, Jun 18, 2008 at 12:25 PM, Jorge Godoy <[EMAIL PROTECTED]> wrote: > On Wednesday 18 June 2008 05:43:25 David wrote: >> * Should I split this into separate threads instead of 1 thread for >> all my questions? > > I would submit all of the questions in separate m

Re: [GENERAL] Database design questions

2008-06-18 Thread David
Hi list. I'm closing this thread, and will re-post as separate questions. I agree with Jorge that smaller mails will be easier to read. David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/

[GENERAL] Database design: Storing app defaults

2008-06-18 Thread David
re another method I should use instead? David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Database design: Backwards-compatible field addition

2008-06-18 Thread David
version number. 6) Find a clever way to use table inheritance I haven't thought it through, but here are some docs I've read on the subject: http://www.postgresql.org/docs/8.1/static/ddl-inherit.html Any other ideas? David. -- Sent via pgsql-general mailing list (pgsql-general@postgres

[GENERAL] Database design: Temporal databases

2008-06-18 Thread David
ir or SQLAlchemy). Or should apps all implement their own 'temporal data access' module, which transparently uses the current date & time until queried for historical data? David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

[GENERAL] Database design: Data synchronization

2008-06-18 Thread David
ur migration app needs to have rules for conflict resolution. David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Database design: Storing app defaults

2008-06-18 Thread David
On Wed, Jun 18, 2008 at 2:20 PM, Karsten Hilbert <[EMAIL PROTECTED]> wrote: > On Wed, Jun 18, 2008 at 02:03:05PM +0200, David wrote: > >> If I want to start providing user-customizable defaults to the >> database (ie, we don't want apps to update database schema), i

Re: [GENERAL] Database design: Storing app defaults

2008-06-19 Thread David
h use SQL directly. More recently I've started working with SQLAlchemy and Elixir in Python. Do those libraries you mention automatically ignore records which have an unexpectedly high version number? (And what if that isn't the correct thing to do in all cases?) Could you provide links

Re: [GENERAL] Database design: Storing app defaults

2008-06-19 Thread David
On Wed, Jun 18, 2008 at 9:30 PM, Shane Ambler <[EMAIL PROTECTED]> wrote: > David wrote: >> >> Hi list. >> >> If you have a table like this: >> >> table1 >> - id >> - field1 >> - field2 >> - field3 >> >> ta

Re: [GENERAL] Database design: Backwards-compatible field addition

2008-06-19 Thread David
to rename tables & make new views each time I need to make backwards-incompatible app updates), but they are there if I need them. David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Database design: Backwards-compatible field addition

2008-06-19 Thread David
Thanks for you reply. On Wed, Jun 18, 2008 at 9:15 PM, Shane Ambler <[EMAIL PROTECTED]> wrote: > David wrote: >> >> Hi list. >> >> If you have an existing table, and apps which use it, then how do you >> add new fields to the table (for new apps),

[GENERAL] Inter-app communication via DB

2008-06-19 Thread David
o hammer the DB & network with constant polling. Any comments? David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Inter-app communication via DB

2008-06-19 Thread David
On Thu, Jun 19, 2008 at 11:25 AM, Karsten Hilbert <[EMAIL PROTECTED]> wrote: > On Thu, Jun 19, 2008 at 11:09:12AM +0200, David wrote: [...] > >> One pattern I've used is for apps to communicate events to each other >> through the database. > > Works nicely wit

Re: [GENERAL] Dump and restore problem

2008-06-19 Thread David
hat the dump, restore, and rsync still work correctly at each step. David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Dump and restore problem

2008-06-22 Thread David
On Sun, Jun 22, 2008 at 3:11 AM, Stuart Luppescu <[EMAIL PROTECTED]> wrote: > On 木, 2008-06-19 at 11:57 +0200, David wrote: >> > pg_restore: [tar archiver] could not open TOC file for input: No >> such >> > file or directory >> >> It sounds like the t

Re: [GENERAL] maintaining referential integrity

2009-06-05 Thread David
On Fri, Jun 5, 2009 at 6:27 PM, Brandon Metcalf wrote: > What would be the best way to maintain referential integrity in the > following situation?   Let's say I have the following table > >  CREATE TABLE workorder ( >      workorder_id INTEGER  NOT NULL, >      part_id      INTEGER  DEFAULT NULL,

[GENERAL] When to use cascading deletes?

2009-06-11 Thread David
al best practices for what types of cascading are appropriate to use when). Any tips? Thanks, David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] When to use cascading deletes?

2009-06-11 Thread David
approach is to have all db schema setup & updates etc in a Python script during development, which is revision controlled (and then later re-used for remote db installs/upgrades). David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscriptio

[GENERAL] Arrays and LIKE

2009-08-08 Thread David
Done a bit of hunting and can't seem to find an answer as to if this sort of thing is possible: SELECT * FROM mail WHERE recipients ILIKE 'david%'; Where recipients is a VARCHAR(128)[] The above doesn't work but thats the sort of thing I want to do... If this is possible

Re: [GENERAL] Arrays and LIKE

2009-08-08 Thread David
, Aug 08, 2009 at 05:04:29PM +0930, David wrote: > > Done a bit of hunting and can't seem to find an answer as to if this > > sort of thing is possible: > > > > SELECT * FROM mail WHERE recipients ILIKE 'david%'; > > > > Where recipients is

Re: [GENERAL] 110,000,000 rows

2010-05-26 Thread david
At work I have one table with 32 million rows, not quite the size you are talking about, but to give you an idea of the performance, the following query returns 14,659 rows in 405ms: SELECT * FROM farm.frame WHERE process_start > '2010-05-26'; process_start is a timestamp without time zone colum

[GENERAL] start/stop error message

2008-11-19 Thread David
e error when passing "stop" The cluster clearly exists and is recognized by pg_ctl. As a result PostgreSQL does not start with the system and must be started and stopped manually. I am running Ubuntu linux (very close to Debian). There must be a configuration error but I cannot find

[GENERAL] pgAdmin error

2008-11-21 Thread David
ion string: host='kepler.fdu.edu' hostaddr=132.238.16.3 dbname='postgres' user='david' password='XX' port=5432 sslmode=require 2008-11-22 01:20:24 QUERY : Set query (kepler.fdu.edu:5432): SET DateStyle=ISO;SELECT oid, pg_encoding_to_char(encoding) AS en

[GENERAL] Sequence Incrementing by 2 insted of 1

2009-04-27 Thread David
Our internal task database is doing something odd in that the sequence is incrementing by 2 instead of 1 and I can't find any reason why I have checked the sequence itself to see if it had somehow got set to increment by 2 but no. The table in question has a number of both before and after trig

Re: [GENERAL] Sequence Incrementing by 2 insted of 1

2009-04-27 Thread David
Looked for that can't find anything and there is no reason why someone would have added that. On Tue, Apr 28, 2009 at 08:24:46AM +0200, A. Kretschmer wrote: > In response to David : > > Our internal task database is doing something odd in that the sequence is > > incrementi

Re: [GENERAL] Sequence Incrementing by 2 insted of 1

2009-04-28 Thread David
Ok got permission to send the code I think I have got all the relevent bits. On Tue, Apr 28, 2009 at 01:01:39AM -0600, Scott Marlowe wrote: > On Tue, Apr 28, 2009 at 12:38 AM, David wrote: > > Looked for that can't find anything and there is no reason why someone > > w

Re: [GENERAL] Sequence Incrementing by 2 insted of 1

2009-04-28 Thread David
Cool thanks that makes sense was hard to pin down because we didn't notice for a while. On Tue, Apr 28, 2009 at 09:31:26AM +0200, Daniel Verite wrote: > David wrote: > > >the sequence is incrementing by 2 instead of 1 and I can't > >find any reason why I h

[GENERAL] Getting ID of last-inserted row

2009-05-20 Thread David
name) VALUES (12345, 'John Smith'); (Where 12345 is the id retrieved from the previous query). I wanted to add this info to the wiki[2], but there doesn't seem to be a way to sign up. Anyway, I thought that other people might find this info useful. David. [1] http://www.sqlalchemy.

Re: [GENERAL] Can I pause the pg_dump or pg_restore

2009-05-20 Thread David
2009/5/20 Grzegorz Jaśkiewicz : > restore you can, kind of pause, by pausing data feed to it. (assuming > you have a control over pipe, and you are using text dump format). > as for pg dump, I don't think there's a way. > pg_dump should be pauseable, if you use your OS's job-handling tools. For in

Fwd: [GENERAL] Getting ID of last-inserted row

2009-05-20 Thread David
>> I never found an adequate (simple and efficient) method for getting >> the primary key ID of the just-inserted row, and usually used >> transactions and "select last value, ordered by id"-type queries to >> get the last id value, or other ugly logic. > > use currval() instead, see > http://www.p

Re: [GENERAL] Suggested way of associating PG user metadata with record

2009-05-20 Thread David
). http://www.postgresql.org/docs/8.2/interactive/view-pg-user.html David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Suggested way of associating PG user metadata with record

2009-05-20 Thread David
>> >> That said, you could also use the value in pg_user.usesysid as a >> unique ID, rather than the account name (if you want to distinguish >> between different users with the same login name, over a period of >> time where users were removed and re-added). > > Perhaps I should just not use a for

Re: [GENERAL] plpython function problem workaround

2005-03-15 Thread David
On Tue, Mar 15, 2005 at 08:09:47AM +0200, Sim Zacks wrote: > I don't think that this type of solution should be discussed as an official > patch. > If it was, I would recommend solving the problem in source code when the > function is passed to the translator. That way each platform could fix the >

Re: [GENERAL] plpython function problem workaround

2005-03-16 Thread David
On Tue, Mar 15, 2005 at 02:50:06PM -0700, Michael Fuhr wrote: > On Tue, Mar 15, 2005 at 03:41:37PM +, Ragnar Hafstað wrote: > > > actually, perl scripts with \r\n line endings will run just fine in > > unix/linux. > > Indeed, and PL/Perl doesn't care. I just tested several PLs with > Postgre

Re: [GENERAL] plpython function problem workaround

2005-03-16 Thread David
On Tue, Mar 15, 2005 at 03:41:37PM +, Ragnar Hafstað wrote: > On Tue, 2005-03-15 at 07:33 -0600, David wrote: > > > [about the line-termination problem in plpython] > > > I'd like to insert one note here. While I'm not particularly familiar > > with eith

[GENERAL] Replication fell out of sync

2015-03-02 Thread David Kerr
Howdy, I had an instance where a replica fell out of sync with the master. Now it's in in a state where it's unable to catch up because the master has already removed the WAL segment. (logs) Mar 2 23:10:13 db13 postgres[11099]: [3-1] user=,db=,host= LOG: streaming replication successfully co

Re: [GENERAL] Replication fell out of sync

2015-03-02 Thread David Kerr
On Mon, Mar 02, 2015 at 03:33:22PM PDT, Joshua D. Drake wrote: > > On 03/02/2015 03:25 PM, David Kerr wrote: > > > >Howdy, > > > >I had an instance where a replica fell out of sync with the master. > > > >Now it's in in a state where it's u

Re: [GENERAL] Replication fell out of sync

2015-03-02 Thread David Kerr
On Mon, Mar 02, 2015 at 04:06:02PM PDT, Adrian Klaver wrote: > On 03/02/2015 03:25 PM, David Kerr wrote: > >Howdy, > > > >I had an instance where a replica fell out of sync with the master. > > > >Now it's in in a state where it's unable to catch up bec

Re: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ?

2015-03-27 Thread Day, David
this out. Best Regards Dave From: Day, David Sent: Wednesday, February 18, 2015 8:07 AM To: 'Guy Helmer' Cc: 'pgsql-general@postgresql.org' Subject: RE: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ? Update/Information sharing: ( FreeBSD 10.0 (amd

[GENERAL] unexpected error " tables can have at most 1600 columns"

2015-04-13 Thread Day, David
Situation I have a co-developer installing a new Virtual Machine and encountering a postgres error during the installation. One of our SQL patch files is failing unexpectedly. The patch is attempting to add columns to a table, The table involved currently has only 2 columns, Interactively I

Re: [GENERAL] unexpected error " tables can have at most 1600 columns"

2015-04-13 Thread Day, David
select count(*) from pg_attribute where attrelid='log.conference_history'::regclass and attnum > 0 and attisdropped; count --- 1598 From: Pavel Stehule [mailto:pavel.steh...@gmail.com] Sent: Monday, April 13, 2015 12:06 PM To: Day, David Cc: pgsql-general@postgresql.org Subject

[GENERAL] plpgsql question: select into multiple variables ?

2015-06-29 Thread Day, David
Hi, Postgres version 9.3.9 What is wrong with my usage of the plpgsql "select into" concept I have a function to look into a calendar table to find the first and Last weekend date of a month. In this simplified concept function I end up with a NULL for first or last weekend variable. cr

Re: [GENERAL] plpgsql question: select into multiple variables ?

2015-06-29 Thread Day, David
-Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Monday, June 29, 2015 4:03 PM To: Day, David; pgsql-general@postgresql.org Subject: Re: [GENERAL] plpgsql question: select into multiple variables ? On 06/29/2015 12:07 PM, Day, David wrote: >

Re: [GENERAL] plpgsql question: select into multiple variables ?

2015-06-30 Thread Day, David
problem was in casts that I was using were confusing the parser and were un-necessary. Appreciate your thought and effort. Regards Dave From: Yasin Sari [mailto:yasinsar...@googlemail.com] Sent: Tuesday, June 30, 2015 3:26 AM To: Day, David Subject: Re: [GENERAL] plpgsql question: select into

  1   2   3   4   5   6   7   8   9   10   >