Re: Converting sql anywhere to postgres

2023-08-16 Thread Adrian Klaver
On 8/16/23 14:16, Rob Sargent wrote: I have just had a quick look at rules and I am not sure how it can be done. Rules still use the concept of NEW and OLD. If my original row has 'myfield' set to 'me' then I don't think I can tell the difference between: Update mytable set afield='somethi

Re: Converting sql anywhere to postgres

2023-08-16 Thread Rob Sargent
> On Aug 16, 2023, at 1:35 PM, Adrian Klaver wrote: > > On 8/16/23 12:01, Rob Sargent wrote: >> On 8/16/23 12:30, Guyren Howe wrote: >>> For some reason, I was thinking the rule could see just the fields from the >>> command, but you’re right; a rule won’t work. Sorry. >>> >>> Guyren G Howe

Re: Converting sql anywhere to postgres

2023-08-16 Thread Adrian Klaver
On 8/16/23 12:01, Rob Sargent wrote: On 8/16/23 12:30, Guyren Howe wrote: For some reason, I was thinking the rule could see just the fields from the command, but you’re right; a rule won’t work. Sorry. Guyren G Howe On Aug 15, 2023 at 23:22 -0700, Russell Rose | Passfield Data Systems , wrot

Re: Converting sql anywhere to postgres

2023-08-16 Thread Rob Sargent
On 8/16/23 12:30, Guyren Howe wrote: For some reason, I was thinking the rule could see just the fields from the command, but you’re right; a rule won’t work. Sorry. Guyren G Howe On Aug 15, 2023 at 23:22 -0700, Russell Rose | Passfield Data Systems , wrote: I have just had a quick look at rul

Re: Converting sql anywhere to postgres

2023-08-16 Thread Guyren Howe
For some reason, I was thinking the rule could see just the fields from the command, but you’re right; a rule won’t work. Sorry. Guyren G Howe On Aug 15, 2023 at 23:22 -0700, Russell Rose | Passfield Data Systems , wrote: > I have just had a quick look at rules and I am not sure how it can be do

Re: Converting sql anywhere to postgres

2023-08-15 Thread Russell Rose | Passfield Data Systems
I have just had a quick look at rules and I am not sure how it can be done. Rules still use the concept of NEW and OLD. If my original row has 'myfield' set to 'me' then I don't think I can tell the difference between: Update mytable set afield='something' and Update mytable set afield='somethin

Re: Converting sql anywhere to postgres

2023-08-15 Thread Peter J. Holzer
On 2023-08-15 18:43:11 +0200, Georg H. wrote: > update mytest.autovalues set product='pear', updated_by=DEFAULT where key=2; Oh, I didn't know that worked. Obvious in hindsight, of course (I've been using DEFAULT in VALUES(...) for a

Re: Converting sql anywhere to postgres

2023-08-15 Thread Guyren Howe
I’m fairly confident you can do this using a Rule. It would even be fairly simple. Be careful, though: Rules are Postgres’ biggest potential foot gun. Guyren G Howe On Aug 15, 2023 at 08:05 -0700, Russell Rose | Passfield Data Systems , wrote: > Hi there > > I am trying to convert a SQL Anywher

Re: Converting sql anywhere to postgres

2023-08-15 Thread Russell Rose | Passfield Data Systems
| Passfield Data Systems ; pgsql-general@lists.postgresql.org Subject: Re: Converting sql anywhere to postgres On 8/15/23 09:43, Georg H. wrote: > Hi, > > Am 15.08.2023 um 17:04 schrieb Russell Rose | Passfield Data Systems: >> >> Hi there >> >> I am trying t

Re: Converting sql anywhere to postgres

2023-08-15 Thread Adrian Klaver
On 8/15/23 09:43, Georg H. wrote: Hi, Am 15.08.2023 um 17:04 schrieb Russell Rose | Passfield Data Systems: Hi there I am trying to convert a SQL Anywhere database to postgres. Within SQL anywhere a field can have a default value of ‘last user’. This means that when you perform an update on

Re: Converting sql anywhere to postgres

2023-08-15 Thread Georg H.
Hi, Am 15.08.2023 um 17:04 schrieb Russell Rose | Passfield Data Systems: Hi there I am trying to convert a SQL Anywhere database to postgres. Within SQL anywhere a field can have a default value of ‘last user’. This means that when you perform an update on a table, if the field is not expl

Re: Converting sql anywhere to postgres

2023-08-15 Thread Erik Wienhold
> On 15/08/2023 17:04 CEST Russell Rose | Passfield Data Systems > wrote: > > I am trying to convert a SQL Anywhere database to postgres. Within SQL > anywhere a field can have a default value of ‘last user’. This means that > when you perform an update on a table, if the field is not explicitly

Re: Converting sql anywhere to postgres

2023-08-15 Thread Adrian Klaver
On 8/15/23 08:04, Russell Rose | Passfield Data Systems wrote: Hi there I am trying to convert a SQL Anywhere database to postgres. Within SQL anywhere a field can have a default value of ‘last user’. This means that when you perform an update on a table, if the field is not explicitly set th

Converting sql anywhere to postgres

2023-08-15 Thread Russell Rose | Passfield Data Systems
Hi there I am trying to convert a SQL Anywhere database to postgres. Within SQL anywhere a field can have a default value of 'last user'. This means that when you perform an update on a table, if the field is not explicitly set then the current user is used. So for instance if I have a field ca