1. Packages
  2. Postgresql Provider
  3. API Docs
  4. getSequences
PostgreSQL v3.15.1 published on Saturday, Mar 15, 2025 by Pulumi

postgresql.getSequences

Explore with Pulumi AI

PostgreSQL v3.15.1 published on Saturday, Mar 15, 2025 by Pulumi

The postgresql.getSequences data source retrieves a list of sequence names from a specified PostgreSQL database.

Usage

import * as pulumi from "@pulumi/pulumi";
import * as postgresql from "@pulumi/postgresql";

const mySequences = postgresql.getSequences({
    database: "my_database",
});
Copy
import pulumi
import pulumi_postgresql as postgresql

my_sequences = postgresql.get_sequences(database="my_database")
Copy
package main

import (
	"github.com/pulumi/pulumi-postgresql/sdk/v3/go/postgresql"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := postgresql.GetSequences(ctx, &postgresql.GetSequencesArgs{
			Database: "my_database",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using PostgreSql = Pulumi.PostgreSql;

return await Deployment.RunAsync(() => 
{
    var mySequences = PostgreSql.GetSequences.Invoke(new()
    {
        Database = "my_database",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.postgresql.PostgresqlFunctions;
import com.pulumi.postgresql.inputs.GetSequencesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var mySequences = PostgresqlFunctions.getSequences(GetSequencesArgs.builder()
            .database("my_database")
            .build());

    }
}
Copy
variables:
  mySequences:
    fn::invoke:
      function: postgresql:getSequences
      arguments:
        database: my_database
Copy

Using getSequences

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSequences(args: GetSequencesArgs, opts?: InvokeOptions): Promise<GetSequencesResult>
function getSequencesOutput(args: GetSequencesOutputArgs, opts?: InvokeOptions): Output<GetSequencesResult>
Copy
def get_sequences(database: Optional[str] = None,
                  like_all_patterns: Optional[Sequence[str]] = None,
                  like_any_patterns: Optional[Sequence[str]] = None,
                  not_like_all_patterns: Optional[Sequence[str]] = None,
                  regex_pattern: Optional[str] = None,
                  schemas: Optional[Sequence[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> GetSequencesResult
def get_sequences_output(database: Optional[pulumi.Input[str]] = None,
                  like_all_patterns: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  like_any_patterns: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  not_like_all_patterns: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  regex_pattern: Optional[pulumi.Input[str]] = None,
                  schemas: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetSequencesResult]
Copy
func GetSequences(ctx *Context, args *GetSequencesArgs, opts ...InvokeOption) (*GetSequencesResult, error)
func GetSequencesOutput(ctx *Context, args *GetSequencesOutputArgs, opts ...InvokeOption) GetSequencesResultOutput
Copy

> Note: This function is named GetSequences in the Go SDK.

public static class GetSequences 
{
    public static Task<GetSequencesResult> InvokeAsync(GetSequencesArgs args, InvokeOptions? opts = null)
    public static Output<GetSequencesResult> Invoke(GetSequencesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSequencesResult> getSequences(GetSequencesArgs args, InvokeOptions options)
public static Output<GetSequencesResult> getSequences(GetSequencesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: postgresql:index/getSequences:getSequences
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Database
This property is required.
Changes to this property will trigger replacement.
string
The PostgreSQL database which will be queried for sequence names.
LikeAllPatterns List<string>
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ALL operators.
LikeAnyPatterns List<string>
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ANY operators.
NotLikeAllPatterns List<string>
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL NOT LIKE ALL operators.
RegexPattern string

Expression which will be pattern matched against sequence names in the query using the PostgreSQL ~ (regular expression match) operator.

Note that all optional arguments can be used in conjunction.

Schemas List<string>
List of PostgreSQL schema(s) which will be queried for sequence names. Queries all schemas in the database by default.
Database
This property is required.
Changes to this property will trigger replacement.
string
The PostgreSQL database which will be queried for sequence names.
LikeAllPatterns []string
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ALL operators.
LikeAnyPatterns []string
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ANY operators.
NotLikeAllPatterns []string
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL NOT LIKE ALL operators.
RegexPattern string

Expression which will be pattern matched against sequence names in the query using the PostgreSQL ~ (regular expression match) operator.

Note that all optional arguments can be used in conjunction.

Schemas []string
List of PostgreSQL schema(s) which will be queried for sequence names. Queries all schemas in the database by default.
database
This property is required.
Changes to this property will trigger replacement.
String
The PostgreSQL database which will be queried for sequence names.
likeAllPatterns List<String>
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ALL operators.
likeAnyPatterns List<String>
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ANY operators.
notLikeAllPatterns List<String>
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL NOT LIKE ALL operators.
regexPattern String

Expression which will be pattern matched against sequence names in the query using the PostgreSQL ~ (regular expression match) operator.

Note that all optional arguments can be used in conjunction.

schemas List<String>
List of PostgreSQL schema(s) which will be queried for sequence names. Queries all schemas in the database by default.
database
This property is required.
Changes to this property will trigger replacement.
string
The PostgreSQL database which will be queried for sequence names.
likeAllPatterns string[]
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ALL operators.
likeAnyPatterns string[]
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ANY operators.
notLikeAllPatterns string[]
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL NOT LIKE ALL operators.
regexPattern string

Expression which will be pattern matched against sequence names in the query using the PostgreSQL ~ (regular expression match) operator.

Note that all optional arguments can be used in conjunction.

schemas string[]
List of PostgreSQL schema(s) which will be queried for sequence names. Queries all schemas in the database by default.
database
This property is required.
Changes to this property will trigger replacement.
str
The PostgreSQL database which will be queried for sequence names.
like_all_patterns Sequence[str]
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ALL operators.
like_any_patterns Sequence[str]
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ANY operators.
not_like_all_patterns Sequence[str]
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL NOT LIKE ALL operators.
regex_pattern str

Expression which will be pattern matched against sequence names in the query using the PostgreSQL ~ (regular expression match) operator.

Note that all optional arguments can be used in conjunction.

schemas Sequence[str]
List of PostgreSQL schema(s) which will be queried for sequence names. Queries all schemas in the database by default.
database
This property is required.
Changes to this property will trigger replacement.
String
The PostgreSQL database which will be queried for sequence names.
likeAllPatterns List<String>
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ALL operators.
likeAnyPatterns List<String>
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL LIKE ANY operators.
notLikeAllPatterns List<String>
List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL NOT LIKE ALL operators.
regexPattern String

Expression which will be pattern matched against sequence names in the query using the PostgreSQL ~ (regular expression match) operator.

Note that all optional arguments can be used in conjunction.

schemas List<String>
List of PostgreSQL schema(s) which will be queried for sequence names. Queries all schemas in the database by default.

getSequences Result

The following output properties are available:

Database string
Id string
The provider-assigned unique ID for this managed resource.
Sequences List<Pulumi.PostgreSql.Outputs.GetSequencesSequence>
A list of PostgreSQL sequences retrieved by this data source. Each sequence consists of the fields documented below.


LikeAllPatterns List<string>
LikeAnyPatterns List<string>
NotLikeAllPatterns List<string>
RegexPattern string
Schemas List<string>
Database string
Id string
The provider-assigned unique ID for this managed resource.
Sequences []GetSequencesSequence
A list of PostgreSQL sequences retrieved by this data source. Each sequence consists of the fields documented below.


LikeAllPatterns []string
LikeAnyPatterns []string
NotLikeAllPatterns []string
RegexPattern string
Schemas []string
database String
id String
The provider-assigned unique ID for this managed resource.
sequences List<GetSequencesSequence>
A list of PostgreSQL sequences retrieved by this data source. Each sequence consists of the fields documented below.


likeAllPatterns List<String>
likeAnyPatterns List<String>
notLikeAllPatterns List<String>
regexPattern String
schemas List<String>
database string
id string
The provider-assigned unique ID for this managed resource.
sequences GetSequencesSequence[]
A list of PostgreSQL sequences retrieved by this data source. Each sequence consists of the fields documented below.


likeAllPatterns string[]
likeAnyPatterns string[]
notLikeAllPatterns string[]
regexPattern string
schemas string[]
database str
id str
The provider-assigned unique ID for this managed resource.
sequences Sequence[GetSequencesSequence]
A list of PostgreSQL sequences retrieved by this data source. Each sequence consists of the fields documented below.


like_all_patterns Sequence[str]
like_any_patterns Sequence[str]
not_like_all_patterns Sequence[str]
regex_pattern str
schemas Sequence[str]
database String
id String
The provider-assigned unique ID for this managed resource.
sequences List<Property Map>
A list of PostgreSQL sequences retrieved by this data source. Each sequence consists of the fields documented below.


likeAllPatterns List<String>
likeAnyPatterns List<String>
notLikeAllPatterns List<String>
regexPattern String
schemas List<String>

Supporting Types

GetSequencesSequence

DataType This property is required. string
The sequence's data type as defined in information_schema.sequences.
ObjectName This property is required. string
The sequence name.
SchemaName This property is required. string
The parent schema.
DataType This property is required. string
The sequence's data type as defined in information_schema.sequences.
ObjectName This property is required. string
The sequence name.
SchemaName This property is required. string
The parent schema.
dataType This property is required. String
The sequence's data type as defined in information_schema.sequences.
objectName This property is required. String
The sequence name.
schemaName This property is required. String
The parent schema.
dataType This property is required. string
The sequence's data type as defined in information_schema.sequences.
objectName This property is required. string
The sequence name.
schemaName This property is required. string
The parent schema.
data_type This property is required. str
The sequence's data type as defined in information_schema.sequences.
object_name This property is required. str
The sequence name.
schema_name This property is required. str
The parent schema.
dataType This property is required. String
The sequence's data type as defined in information_schema.sequences.
objectName This property is required. String
The sequence name.
schemaName This property is required. String
The parent schema.

Package Details

Repository
PostgreSQL pulumi/pulumi-postgresql
License
Apache-2.0
Notes
This Pulumi package is based on the postgresql Terraform Provider.
PostgreSQL v3.15.1 published on Saturday, Mar 15, 2025 by Pulumi