Tagged Questions
4
votes
1answer
1k views
Create index if it does not exist
I am working on a function that allows me to add an index if it does not exist. I am running into the problem that I cannot get a list of indexes to compare to. Any thoughts?
This is a similar issue ...
2
votes
2answers
214 views
Bug in PL/pgSQL function creation
I don't know if this question better suits here or in SO ...
This is a script that I'd like to launch (the code of the function was copied from a question on SO):
\c mydb
create or replace function ...
2
votes
2answers
3k views
Postgres plpgsql - Using a variable inside of a dynamic create statement
Using Postgres pl/pgsql, I'm attempting to create a table using a dynamic EXECUTE command, such as:
...
DECLARE
tblVar varchar := "myTable";
BEGIN
EXECUTE 'CREATE TABLE $1 (
foo ...