On Sun, Aug 13, 2023 at 11:27 AM Rhys A.D. Stewart
wrote:
>
> Hey Adrian,
>
> Thanks for your response. I don't think I explained myself clearly.
> pk_col is not the column name. pk_col is a variable that holds the
> name of a column. This is one trigger for several tables with varying
> structure
On Sat, Aug 12, 2023 at 1:10 PM Rhys A.D. Stewart
wrote:
> Am I missing out on a simpler or more elegant solution?
>
>
No, you are not (at least among SQL and pl/pgsql. SQL is strongly and
statically typed. Circumventing that has a cost, but at least you do have
tools at hand when you find the
On 8/12/23 20:21, Rhys A.D. Stewart wrote:
Hey Adrian,
Thanks for your response. I don't think I explained myself clearly.
pk_col is not the column name. pk_col is a variable that holds the
name of a column. This is one trigger for several tables with varying
structures. So pk_col would be a col
Hey Adrian,
Thanks for your response. I don't think I explained myself clearly.
pk_col is not the column name. pk_col is a variable that holds the
name of a column. This is one trigger for several tables with varying
structures. So pk_col would be a column specific to the current
TG_TABLE_NAME whe
Hi,
On Sat, Aug 12, 2023 at 6:23 PM Miles Elam
wrote:
> > On 8/12/23 9:02 a.m., Amn Ojee Uw wrote:
> >
> > Is there a book to be recommended for PostgreSQL beginners?
>
I’m the author of Practical SQL from No Starch Press. My book combines an
intro to SQL with lessons on data analysis. Learn mo
> On 8/12/23 9:02 a.m., Amn Ojee Uw wrote:
>
> Is there a book to be recommended for PostgreSQL beginners?
If you are new to relational databases and SQL in general, I recommend
the basics of SQL (not Postgres-specific) to start off. The SQL Murder
Mystery is a good first experience.
https://myst
On 8/12/23 13:09, Rhys A.D. Stewart wrote:
Greetings all,
I am writing a trigger and would like to know how to dynamically
access a column from the "OLD" variable. pk_col is the column name
from the table.
I've come up with either doing this:
EXECUTE format('SELECT $1.%1$I', pk_col) INTO pk_val
On 8/12/23 13:09, Rhys A.D. Stewart wrote:
Greetings all,
I am writing a trigger and would like to know how to dynamically
access a column from the "OLD" variable. pk_col is the column name
from the table.
I've come up with either doing this:
EXECUTE format('SELECT $1.%1$I', pk_col) INTO pk_val
Greetings all,
I am writing a trigger and would like to know how to dynamically
access a column from the "OLD" variable. pk_col is the column name
from the table.
I've come up with either doing this:
EXECUTE format('SELECT $1.%1$I', pk_col) INTO pk_val USING OLD;
which looks a bit excessive, or
*Addendum* : I am using JDBC as the framework.
On 8/12/23 9:02 a.m., Amn Ojee Uw wrote:
Hello folks.
Is there a book to be recommended for PostgreSQL beginners?
Thanks in advance.
Hello folks.
Is there a book to be recommended for PostgreSQL beginners?
Thanks in advance.
Thanks Rob,
no it's not a problem with the index. It's a problem with the use of
CURRENT_USER in the WHERE
I submitted a new post on this matter with a test case.
Kind regards
==
Dürr Software Entw.
Guggenberg 26, DE-82380 Peißenberg
fon: +49-8803-4899016
Thanks Adrian,
sorry for the misunderstanding.
I ran ANALYZE, it didn't change a thing (as expected).
Anyway, I pinned the problem down now: It's the use of CURRENT_USER (or
SESSION_USER etc.) in the WHERE condition.
If i replace it with 'postgres' (the result of CURRENT_USER) the planner
works
On 2023-08-09 14:35:40 -0400, Erik Nelson wrote:
> I have a lab with a database that I would like to use as a "multi-tenant"
> database, in that I would like to create a database for each of the
> applications that I'm running and segregate access so that user foo and user
> bar cannot see anything
14 matches
Mail list logo