Hi list,
First steps in trigger functions and PL/pgSQL so please bear with me...
How can one detect changes to certain fields in before update trigger
functions?
IF (NEW. != OLD.) THEN ...
doesn't work, so obviously my understanding of the values of the
varriables NEW and OLD in before update
Quoth Adrian Klaver <[EMAIL PROTECTED]>:
> On Monday 01 December 2008 7:18:51 am Sebastian Tennant wrote:
>> I had thought that OLD holds the record as it was before the update,
>> and that NEW holds the record as it is since the update (but before
>> the update h
Quoth "Richard Broersma" <[EMAIL PROTECTED]>:
> On Mon, Dec 1, 2008 at 7:18 AM, Sebastian Tennant
> <[EMAIL PROTECTED]> wrote:
>
>> IF (NEW. != OLD.) THEN ...
>
> The != operator doesn't work the way you might think when nulls are
> thrown int
Quoth "Richard Broersma" <[EMAIL PROTECTED]>:
> On Mon, Dec 1, 2008 at 8:35 AM, Sebastian Tennant
> <[EMAIL PROTECTED]> wrote:
>>>> IF (NEW. != OLD.) THEN ...
>>>
>>> IF( NEW.* IS DISTINCT FROM OLD.* ) THEN ...
>>>
>> I som
Quoth Tom Lane <[EMAIL PROTECTED]>:
> Sebastian Tennant <[EMAIL PROTECTED]> writes:
>> I sometimes think this kind of gotcha is purposely buried, or not
>> addressed at all, in order to force users to read the manual.
>
> Where exactly do you think we should docume
Quoth Alvaro Herrera <[EMAIL PROTECTED]>:
> Sebastian Tennant wrote:
>
>> P.S. Emacs users of PostgreSQL might like to know that there's a
>> texinfo version of the manual (version 8.3.3) available for
>> download from here:
>>
>>
Quoth Alvaro Herrera <[EMAIL PROTECTED]>:
> Sebastian Tennant wrote:
>> Quoth Alvaro Herrera <[EMAIL PROTECTED]>:
>> > Sebastian Tennant wrote:
>> >
>> >> P.S. Emacs users of PostgreSQL might like to know that there's a
>> >&g
Hi all,
Here's an odd one:
itidb=> \d joblist;
Table "public.joblist"
Column | Type | Modifiers
---+--+---
full_name | character varying(64)| not null
email_address | charact
Hi Osvaldo,
Your list_fields function looked interesting to me so I tried it out and
it only worked for one of the five or so tables in the database I was
connected to at the time.
More concerning is the fact that I can't seem to drop it. I'm told it
doesn't exist, and then I use it to prove (to
Quoth "Merlin Moncure" <[EMAIL PROTECTED]>:
> It looks to me like you are setting the whole table to the same
> address in the update statement (no where clause)...so of course you'd
> get the error. Maybe you want to do an insert statement?
>
> merlin
Doh! Thanks Merlin. I'm so glad it's just
Quoth Raymond O'Donnell <[EMAIL PROTECTED]>:
> On 06/12/2008 16:02, Sebastian Tennant wrote:
>> Here's it working:
>>
>> itidb=> select list_fields('joblist');
>
>
>
>> Here's me trying to drop it, only to be told it
Hi all,
I'd like to make a single query that returns a number of rows using a
'WHERE id IN ()' condition, but I'd like the rows to be
returned in the order in which the ids are given in the list.
Is this possible?
Sebastian
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
Quoth "Adam Rich" :
>> I'd like to make a single query that returns a number of rows using a
>> 'WHERE id IN ()' condition, but I'd like the rows to be
>> returned in the order in which the ids are given in the list.
>>
> Depending on how many IDs you have in your list, you can accomplish this
> wi
Hello,
Here's a step-by-step guide to building the PostgreSQL manual in Info
format on a Debian Lenny box:
First of all, you may made need to install a few extra packages:
$ sudo apt-get install bzip2 docbook-dsssl docbook2x opensp
Next, download the PostgreSQL source (using apt), unpack it a
Hi there,
Just noticed this in my webapp logs:
ERROR: FATAL: the database system is in recovery mode
Only one instance, so I'm not too concerned, but why, how often, how
long for, etc.
Am I negelecting to do some important database maintenace?
Could it be related to the backup cron performs
Quoth Kusuma Pabba :
> /usr/local/pgsql/bin/psql test
> test=#
> sudo su postgres -c psql template1
> template=#
> why is the path different in both cases?
Type:
$ which psql
and
$ sudo which psql
The answer is the same, yes?
$ /usr/local/pgsql/bin/psql test
|___|
Hi all,
A school wants to offer a number of short courses on a number of different
dates. Students apply online for a single course at a time and choose one or
more dates (from a list) which would suit them. Once the application period is
over which course is taught when is decided soley on the b
Quoth Sam Mason :
[...]
> The only table that's really needed to solve your original problem would
> be the last one, but the others provide all the checks that the data
> is actually going in correctly and may or may not be useful depending
> on your problem. The main thing to notice is lots of
Hi list,
Given an 'applications' table for a static set of courses::
user_id (integer)
course_name (text)
completed (boolean)
how best should I go about creating an 'alumni' view with columns:
user_id (integer)
maths (boolean)
english (boolean)
. .
. .
. .
w
Quoth "David Johnston" :
> A) SELECT user_id, CASE WHEN course_name = 'Maths' THEN completed ELSE false
> END math_cmp, CASE WHEN course_name = 'English' THEN completed ELSE false
> END AS english_cmp FROM applications
> a) Expand to multiple columns and store either the default "false" or the
20 matches
Mail list logo